Skip to content

Commit bcac0a7

Browse files
committed
isbn-verifier: add input objects
1 parent ababa18 commit bcac0a7

File tree

1 file changed

+40
-14
lines changed

1 file changed

+40
-14
lines changed

exercises/isbn-verifier/canonical-data.json

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"exercise": "isbn-verifier",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"comments": [
55
"An expected value of true indicates a valid ISBN-10, ",
66
"whereas false means the ISBN-10 is invalid."
@@ -9,79 +9,105 @@
99
{
1010
"description": "valid isbn number",
1111
"property": "isValid",
12-
"input": "3-598-21508-8",
12+
"input": {
13+
"isbn": "3-598-21508-8"
14+
},
1315
"expected": true
1416
},
1517
{
1618
"description": "invalid isbn check digit",
1719
"property": "isValid",
18-
"input": "3-598-21508-9",
20+
"input": {
21+
"isbn": "3-598-21508-9"
22+
},
1923
"expected": false
2024
},
2125
{
2226
"description": "valid isbn number with a check digit of 10",
2327
"property": "isValid",
24-
"input": "3-598-21507-X",
28+
"input": {
29+
"isbn": "3-598-21507-X"
30+
},
2531
"expected": true
2632
},
2733
{
2834
"description": "check digit is a character other than X",
2935
"property": "isValid",
30-
"input": "3-598-21507-A",
36+
"input": {
37+
"isbn": "3-598-21507-A"
38+
},
3139
"expected": false
3240
},
3341
{
3442
"description": "invalid character in isbn",
3543
"property": "isValid",
36-
"input": "3-598-2K507-0",
44+
"input": {
45+
"isbn": "3-598-2K507-0"
46+
},
3747
"expected": false
3848
},
3949
{
4050
"description": "X is only valid as a check digit",
4151
"property": "isValid",
42-
"input": "3-598-2X507-9",
52+
"input": {
53+
"isbn": "3-598-2X507-9"
54+
},
4355
"expected": false
4456
},
4557
{
4658
"description": "valid isbn without separating dashes",
4759
"property": "isValid",
48-
"input": "3598215088",
60+
"input": {
61+
"isbn": "3598215088"
62+
},
4963
"expected": true
5064
},
5165
{
5266
"description": "isbn without separating dashes and X as check digit",
5367
"property": "isValid",
54-
"input": "359821507X",
68+
"input": {
69+
"isbn": "359821507X"
70+
},
5571
"expected": true
5672
},
5773
{
5874
"description": "isbn without check digit and dashes",
5975
"property": "isValid",
60-
"input": "359821507",
76+
"input": {
77+
"isbn": "359821507"
78+
},
6179
"expected": false
6280
},
6381
{
6482
"description": "too long isbn and no dashes",
6583
"property": "isValid",
66-
"input": "3598215078X",
84+
"input": {
85+
"isbn": "3598215078X"
86+
},
6787
"expected": false
6888
},
6989
{
7090
"description": "isbn without check digit",
7191
"property": "isValid",
72-
"input": "3-598-21507",
92+
"input": {
93+
"isbn": "3-598-21507"
94+
},
7395
"expected": false
7496
},
7597
{
7698
"description": "too long isbn",
7799
"property": "isValid",
78-
"input": "3-598-21507-XX",
100+
"input": {
101+
"isbn": "3-598-21507-XX"
102+
},
79103
"expected": false
80104
},
81105
{
82106
"description": "check digit of X should not be used for 0",
83107
"property": "isValid",
84-
"input": "3-598-21515-X",
108+
"input": {
109+
"isbn": "3-598-21515-X"
110+
},
85111
"expected": false
86112
}
87113
]

0 commit comments

Comments
 (0)