Skip to content

Commit 4119671

Browse files
tqa236rpottsoh
authored andcommitted
Hamming: Add a tests to avoid wrong recursion solution (#1450)
Add an extra test case about one empty strand based on the discussion in exercism/haskell#796 to avoid wrong recursion solution.
1 parent 17d157a commit 4119671

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

exercises/hamming/canonical-data.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"exercise": "hamming",
3-
"version": "2.2.0",
3+
"version": "2.3.0",
44
"comments": [
55
"Language implementations vary on the issue of unequal length strands.",
66
"A language may elect to simplify this task by only presenting equal",
@@ -73,6 +73,24 @@
7373
"strand2": "AGTG"
7474
},
7575
"expected": {"error": "left and right strands must be of equal length"}
76+
},
77+
{
78+
"description": "disallow left empty strand",
79+
"property": "distance",
80+
"input": {
81+
"strand1": "",
82+
"strand2": "G"
83+
},
84+
"expected": {"error": "left strand must not be empty"}
85+
},
86+
{
87+
"description": "disallow right empty strand",
88+
"property": "distance",
89+
"input": {
90+
"strand1": "G",
91+
"strand2": ""
92+
},
93+
"expected": {"error": "right strand must not be empty"}
7694
}
7795
]
7896
}

0 commit comments

Comments
 (0)