|
1 | 1 | {
|
2 | 2 | "exercise": "isbn-verifier",
|
3 |
| - "version": "2.0.0", |
| 3 | + "version": "2.1.0", |
4 | 4 | "comments": [
|
5 | 5 | "An expected value of true indicates a valid ISBN-10, ",
|
6 | 6 | "whereas false means the ISBN-10 is invalid."
|
|
9 | 9 | {
|
10 | 10 | "description": "valid isbn number",
|
11 | 11 | "property": "isValid",
|
12 |
| - "input": "3-598-21508-8", |
| 12 | + "input": { |
| 13 | + "isbn": "3-598-21508-8" |
| 14 | + }, |
13 | 15 | "expected": true
|
14 | 16 | },
|
15 | 17 | {
|
16 | 18 | "description": "invalid isbn check digit",
|
17 | 19 | "property": "isValid",
|
18 |
| - "input": "3-598-21508-9", |
| 20 | + "input": { |
| 21 | + "isbn": "3-598-21508-9" |
| 22 | + }, |
19 | 23 | "expected": false
|
20 | 24 | },
|
21 | 25 | {
|
22 | 26 | "description": "valid isbn number with a check digit of 10",
|
23 | 27 | "property": "isValid",
|
24 |
| - "input": "3-598-21507-X", |
| 28 | + "input": { |
| 29 | + "isbn": "3-598-21507-X" |
| 30 | + }, |
25 | 31 | "expected": true
|
26 | 32 | },
|
27 | 33 | {
|
28 | 34 | "description": "check digit is a character other than X",
|
29 | 35 | "property": "isValid",
|
30 |
| - "input": "3-598-21507-A", |
| 36 | + "input": { |
| 37 | + "isbn": "3-598-21507-A" |
| 38 | + }, |
31 | 39 | "expected": false
|
32 | 40 | },
|
33 | 41 | {
|
34 | 42 | "description": "invalid character in isbn",
|
35 | 43 | "property": "isValid",
|
36 |
| - "input": "3-598-2K507-0", |
| 44 | + "input": { |
| 45 | + "isbn": "3-598-2K507-0" |
| 46 | + }, |
37 | 47 | "expected": false
|
38 | 48 | },
|
39 | 49 | {
|
40 | 50 | "description": "X is only valid as a check digit",
|
41 | 51 | "property": "isValid",
|
42 |
| - "input": "3-598-2X507-9", |
| 52 | + "input": { |
| 53 | + "isbn": "3-598-2X507-9" |
| 54 | + }, |
43 | 55 | "expected": false
|
44 | 56 | },
|
45 | 57 | {
|
46 | 58 | "description": "valid isbn without separating dashes",
|
47 | 59 | "property": "isValid",
|
48 |
| - "input": "3598215088", |
| 60 | + "input": { |
| 61 | + "isbn": "3598215088" |
| 62 | + }, |
49 | 63 | "expected": true
|
50 | 64 | },
|
51 | 65 | {
|
52 | 66 | "description": "isbn without separating dashes and X as check digit",
|
53 | 67 | "property": "isValid",
|
54 |
| - "input": "359821507X", |
| 68 | + "input": { |
| 69 | + "isbn": "359821507X" |
| 70 | + }, |
55 | 71 | "expected": true
|
56 | 72 | },
|
57 | 73 | {
|
58 | 74 | "description": "isbn without check digit and dashes",
|
59 | 75 | "property": "isValid",
|
60 |
| - "input": "359821507", |
| 76 | + "input": { |
| 77 | + "isbn": "359821507" |
| 78 | + }, |
61 | 79 | "expected": false
|
62 | 80 | },
|
63 | 81 | {
|
64 | 82 | "description": "too long isbn and no dashes",
|
65 | 83 | "property": "isValid",
|
66 |
| - "input": "3598215078X", |
| 84 | + "input": { |
| 85 | + "isbn": "3598215078X" |
| 86 | + }, |
67 | 87 | "expected": false
|
68 | 88 | },
|
69 | 89 | {
|
70 | 90 | "description": "isbn without check digit",
|
71 | 91 | "property": "isValid",
|
72 |
| - "input": "3-598-21507", |
| 92 | + "input": { |
| 93 | + "isbn": "3-598-21507" |
| 94 | + }, |
73 | 95 | "expected": false
|
74 | 96 | },
|
75 | 97 | {
|
76 | 98 | "description": "too long isbn",
|
77 | 99 | "property": "isValid",
|
78 |
| - "input": "3-598-21507-XX", |
| 100 | + "input": { |
| 101 | + "isbn": "3-598-21507-XX" |
| 102 | + }, |
79 | 103 | "expected": false
|
80 | 104 | },
|
81 | 105 | {
|
82 | 106 | "description": "check digit of X should not be used for 0",
|
83 | 107 | "property": "isValid",
|
84 |
| - "input": "3-598-21515-X", |
| 108 | + "input": { |
| 109 | + "isbn": "3-598-21515-X" |
| 110 | + }, |
85 | 111 | "expected": false
|
86 | 112 | }
|
87 | 113 | ]
|
|
0 commit comments