/
canonical-data.json
214 lines (214 loc) · 5.83 KB
/
canonical-data.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
{
"exercise": "luhn",
"cases": [
{
"uuid": "792a7082-feb7-48c7-b88b-bbfec160865e",
"description": "single digit strings can not be valid",
"property": "valid",
"input": {
"value": "1"
},
"expected": false
},
{
"uuid": "698a7924-64d4-4d89-8daa-32e1aadc271e",
"description": "a single zero is invalid",
"property": "valid",
"input": {
"value": "0"
},
"expected": false
},
{
"uuid": "73c2f62b-9b10-4c9f-9a04-83cee7367965",
"description": "a simple valid SIN that remains valid if reversed",
"property": "valid",
"input": {
"value": "059"
},
"expected": true
},
{
"uuid": "9369092e-b095-439f-948d-498bd076be11",
"description": "a simple valid SIN that becomes invalid if reversed",
"property": "valid",
"input": {
"value": "59"
},
"expected": true
},
{
"uuid": "8f9f2350-1faf-4008-ba84-85cbb93ffeca",
"description": "a valid Canadian SIN",
"property": "valid",
"input": {
"value": "055 444 285"
},
"expected": true
},
{
"uuid": "1cdcf269-6560-44fc-91f6-5819a7548737",
"description": "invalid Canadian SIN",
"property": "valid",
"input": {
"value": "055 444 286"
},
"expected": false
},
{
"uuid": "656c48c1-34e8-4e60-9a5a-aad8a367810a",
"description": "invalid credit card",
"property": "valid",
"input": {
"value": "8273 1232 7352 0569"
},
"expected": false
},
{
"uuid": "20e67fad-2121-43ed-99a8-14b5b856adb9",
"description": "invalid long number with an even remainder",
"property": "valid",
"input": {
"value": "1 2345 6789 1234 5678 9012"
},
"expected": false
},
{
"uuid": "7e7c9fc1-d994-457c-811e-d390d52fba5e",
"description": "invalid long number with a remainder divisible by 5",
"property": "valid",
"input": {
"value": "1 2345 6789 1234 5678 9013"
},
"expected": false
},
{
"uuid": "ad2a0c5f-84ed-4e5b-95da-6011d6f4f0aa",
"description": "valid number with an even number of digits",
"property": "valid",
"input": {
"value": "095 245 88"
},
"expected": true
},
{
"uuid": "ef081c06-a41f-4761-8492-385e13c8202d",
"description": "valid number with an odd number of spaces",
"property": "valid",
"input": {
"value": "234 567 891 234"
},
"expected": true
},
{
"uuid": "bef66f64-6100-4cbb-8f94-4c9713c5e5b2",
"description": "valid strings with a non-digit added at the end become invalid",
"property": "valid",
"input": {
"value": "059a"
},
"expected": false
},
{
"uuid": "2177e225-9ce7-40f6-b55d-fa420e62938e",
"description": "valid strings with punctuation included become invalid",
"property": "valid",
"input": {
"value": "055-444-285"
},
"expected": false
},
{
"uuid": "ebf04f27-9698-45e1-9afe-7e0851d0fe8d",
"description": "valid strings with symbols included become invalid",
"property": "valid",
"input": {
"value": "055# 444$ 285"
},
"expected": false
},
{
"uuid": "08195c5e-ce7f-422c-a5eb-3e45fece68ba",
"description": "single zero with space is invalid",
"property": "valid",
"input": {
"value": " 0"
},
"expected": false
},
{
"uuid": "12e63a3c-f866-4a79-8c14-b359fc386091",
"description": "more than a single zero is valid",
"property": "valid",
"input": {
"value": "0000 0"
},
"expected": true
},
{
"uuid": "ab56fa80-5de8-4735-8a4a-14dae588663e",
"description": "input digit 9 is correctly converted to output digit 9",
"property": "valid",
"input": {
"value": "091"
},
"expected": true
},
{
"uuid": "b9887ee8-8337-46c5-bc45-3bcab51bc36f",
"description": "very long input is valid",
"comments": [
"Designed to prevent converting input to a single number as this approach can risk an overflow"
],
"property": "valid",
"input": {
"value": "9999999999 9999999999 9999999999 9999999999"
},
"expected": true
},
{
"uuid": "8a7c0e24-85ea-4154-9cf1-c2db90eabc08",
"description": "valid luhn with an odd number of digits and non zero first digit",
"property": "valid",
"input": {
"value": "109"
},
"expected": true
},
{
"uuid": "39a06a5a-5bad-4e0f-b215-b042d46209b1",
"description": "using ascii value for non-doubled non-digit isn't allowed",
"comments": [
"Convert non-digits to their ascii values and then offset them by 48 sometimes accidentally declare an invalid string to be valid.",
"This test is designed to avoid that solution."
],
"property": "valid",
"input": {
"value": "055b 444 285"
},
"expected": false
},
{
"uuid": "f94cf191-a62f-4868-bc72-7253114aa157",
"description": "using ascii value for doubled non-digit isn't allowed",
"comments": [
"Convert non-digits to their ascii values and then offset them by 48 sometimes accidentally declare an invalid string to be valid.",
"This test is designed to avoid that solution."
],
"property": "valid",
"input": {
"value": ":9"
},
"expected": false
},
{
"uuid": "8b72ad26-c8be-49a2-b99c-bcc3bf631b33",
"description": "non-numeric, non-space char in the middle with a sum that's divisible by 10 isn't allowed",
"property": "valid",
"input": {
"value": "59%59"
},
"expected": false
}
]
}