Skip to content

Commit adb99f7

Browse files
mikestrattonpetertseng
authored andcommitted
isbn-verifier: Add test case with only 9 digits (#1221)
fixes #1216 ``` 1 * 10 + 3 * 9 + 4 * 8 + 4 * 7 + 5 * 6 + 6 * 5 + 7 * 4 + 2 * 3 + 9 * 2 = 209 ``` 209 is divisible by 11. Thus, an implementation that appends 0 will incorrectly accept this case.
1 parent 07cd334 commit adb99f7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

exercises/isbn-verifier/canonical-data.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"exercise": "isbn-verifier",
3-
"version": "2.3.0",
3+
"version": "2.4.0",
44
"comments": [
55
"An expected value of true indicates a valid ISBN-10, ",
66
"whereas false means the ISBN-10 is invalid."
@@ -117,6 +117,14 @@
117117
"isbn": ""
118118
},
119119
"expected": false
120+
},
121+
{
122+
"description": "input is 9 characters",
123+
"property": "isValid",
124+
"input": {
125+
"isbn": "134456729"
126+
},
127+
"expected": false
120128
}
121129
]
122130
}

0 commit comments

Comments
 (0)