-
-
Notifications
You must be signed in to change notification settings - Fork 546
/
Copy pathcanonical-data.json
254 lines (254 loc) · 6.95 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
{
"exercise": "phone-number",
"comments": [
" Returns the cleaned phone number if given number is valid, ",
" else returns error object. Note that number is not formatted,",
" just a 10-digit number is returned. "
],
"cases": [
{
"uuid": "79666dce-e0f1-46de-95a1-563802913c35",
"description": "cleans the number",
"property": "clean",
"input": {
"phrase": "(223) 456-7890"
},
"expected": "2234567890"
},
{
"uuid": "c360451f-549f-43e4-8aba-fdf6cb0bf83f",
"description": "cleans numbers with dots",
"property": "clean",
"input": {
"phrase": "223.456.7890"
},
"expected": "2234567890"
},
{
"uuid": "08f94c34-9a37-46a2-a123-2a8e9727395d",
"description": "cleans numbers with multiple spaces",
"property": "clean",
"input": {
"phrase": "223 456 7890 "
},
"expected": "2234567890"
},
{
"uuid": "598d8432-0659-4019-a78b-1c6a73691d21",
"description": "invalid when 9 digits",
"property": "clean",
"input": {
"phrase": "123456789"
},
"expected": {
"error": "incorrect number of digits"
}
},
{
"uuid": "2de74156-f646-42b5-8638-0ef1d8b58bc2",
"reimplements": "598d8432-0659-4019-a78b-1c6a73691d21",
"description": "invalid when 9 digits",
"comments": ["Make incorrect number of digit errors consistent."],
"property": "clean",
"input": {
"phrase": "123456789"
},
"expected": {
"error": "must not be fewer than 10 digits"
}
},
{
"uuid": "57061c72-07b5-431f-9766-d97da7c4399d",
"description": "invalid when 11 digits does not start with a 1",
"property": "clean",
"input": {
"phrase": "22234567890"
},
"expected": {
"error": "11 digits must start with 1"
}
},
{
"uuid": "9962cbf3-97bb-4118-ba9b-38ff49c64430",
"description": "valid when 11 digits and starting with 1",
"property": "clean",
"input": {
"phrase": "12234567890"
},
"expected": "2234567890"
},
{
"uuid": "fa724fbf-054c-4d91-95da-f65ab5b6dbca",
"description": "valid when 11 digits and starting with 1 even with punctuation",
"property": "clean",
"input": {
"phrase": "+1 (223) 456-7890"
},
"expected": "2234567890"
},
{
"uuid": "c6a5f007-895a-4fc5-90bc-a7e70f9b5cad",
"description": "invalid when more than 11 digits",
"property": "clean",
"input": {
"phrase": "321234567890"
},
"expected": {
"error": "more than 11 digits"
}
},
{
"uuid": "4a1509b7-8953-4eec-981b-c483358ff531",
"reimplements": "c6a5f007-895a-4fc5-90bc-a7e70f9b5cad",
"description": "invalid when more than 11 digits",
"comments": ["Make incorrect number of digit errors consistent."],
"property": "clean",
"input": {
"phrase": "321234567890"
},
"expected": {
"error": "must not be greater than 11 digits"
}
},
{
"uuid": "63f38f37-53f6-4a5f-bd86-e9b404f10a60",
"description": "invalid with letters",
"property": "clean",
"input": {
"phrase": "123-abc-7890"
},
"expected": {
"error": "letters not permitted"
}
},
{
"uuid": "eb8a1fc0-64e5-46d3-b0c6-33184208e28a",
"reimplements": "63f38f37-53f6-4a5f-bd86-e9b404f10a60",
"description": "invalid with letters",
"comments": [
"make input invalid only due to letters; area code may not start with 1"
],
"property": "clean",
"input": {
"phrase": "523-abc-7890"
},
"expected": {
"error": "letters not permitted"
}
},
{
"uuid": "4bd97d90-52fd-45d3-b0db-06ab95b1244e",
"description": "invalid with punctuations",
"property": "clean",
"input": {
"phrase": "123-@:!-7890"
},
"expected": {
"error": "punctuations not permitted"
}
},
{
"uuid": "065f6363-8394-4759-b080-e6c8c351dd1f",
"reimplements": "4bd97d90-52fd-45d3-b0db-06ab95b1244e",
"description": "invalid with punctuations",
"comments": [
"make input invalid only due to punctuation; area code may not start with 1"
],
"property": "clean",
"input": {
"phrase": "523-@:!-7890"
},
"expected": {
"error": "punctuations not permitted"
}
},
{
"uuid": "d77d07f8-873c-4b17-8978-5f66139bf7d7",
"description": "invalid if area code starts with 0",
"property": "clean",
"input": {
"phrase": "(023) 456-7890"
},
"expected": {
"error": "area code cannot start with zero"
}
},
{
"uuid": "c7485cfb-1e7b-4081-8e96-8cdb3b77f15e",
"description": "invalid if area code starts with 1",
"property": "clean",
"input": {
"phrase": "(123) 456-7890"
},
"expected": {
"error": "area code cannot start with one"
}
},
{
"uuid": "4d622293-6976-413d-b8bf-dd8a94d4e2ac",
"description": "invalid if exchange code starts with 0",
"property": "clean",
"input": {
"phrase": "(223) 056-7890"
},
"expected": {
"error": "exchange code cannot start with zero"
}
},
{
"uuid": "4cef57b4-7d8e-43aa-8328-1e1b89001262",
"description": "invalid if exchange code starts with 1",
"property": "clean",
"input": {
"phrase": "(223) 156-7890"
},
"expected": {
"error": "exchange code cannot start with one"
}
},
{
"uuid": "9925b09c-1a0d-4960-a197-5d163cbe308c",
"description": "invalid if area code starts with 0 on valid 11-digit number",
"property": "clean",
"input": {
"phrase": "1 (023) 456-7890"
},
"expected": {
"error": "area code cannot start with zero"
}
},
{
"uuid": "3f809d37-40f3-44b5-ad90-535838b1a816",
"description": "invalid if area code starts with 1 on valid 11-digit number",
"property": "clean",
"input": {
"phrase": "1 (123) 456-7890"
},
"expected": {
"error": "area code cannot start with one"
}
},
{
"uuid": "e08e5532-d621-40d4-b0cc-96c159276b65",
"description": "invalid if exchange code starts with 0 on valid 11-digit number",
"property": "clean",
"input": {
"phrase": "1 (223) 056-7890"
},
"expected": {
"error": "exchange code cannot start with zero"
}
},
{
"uuid": "57b32f3d-696a-455c-8bf1-137b6d171cdf",
"description": "invalid if exchange code starts with 1 on valid 11-digit number",
"property": "clean",
"input": {
"phrase": "1 (223) 156-7890"
},
"expected": {
"error": "exchange code cannot start with one"
}
}
]
}