From 1cee9d9f1b28f6acb54f731f8b6502b52f8860fe Mon Sep 17 00:00:00 2001 From: Konrad Klawonn Date: Wed, 16 Nov 2022 13:22:20 +0100 Subject: [PATCH] Add test case A new test case for certain solutions that would satisfy all previous tests but would still be wrong --- exercises/dominoes/canonical-data.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/exercises/dominoes/canonical-data.json b/exercises/dominoes/canonical-data.json index a2925a3dc6..7cf3ab4458 100644 --- a/exercises/dominoes/canonical-data.json +++ b/exercises/dominoes/canonical-data.json @@ -170,6 +170,20 @@ "dominoes": [[1, 2], [2, 3], [3, 1], [4, 5], [5, 6], [6, 4]] }, "expected": false + }, + { + "uuid": "709f7b9e-239d-4e20-b4a1-61f46257a647", + "description": "can't try forever", + "comments": [ + "Some solutions try to build a chain and backtrack when none is found", + "but can end up in infinite loops, when not properly taken care of.", + "This ensures that such cases are identified." + ], + "property": "canChain", + "input": { + "dominoes": [[1, 2], [2, 4], [4, 2], [4, 3]] + }, + "expected": false } ] }