Skip to content

Commit f2a2c56

Browse files
authored
phone number: only one problem per test input (#1959)
* [Phone Number] Only one problem per test input Because the area code is not allowed to start with 0 or 1, inputs designed to elicit other errors should not use area codes that start with either of those digits. * Respect immutability * Correct field name: s/comment/comments/ * Comments should contain a list. * Allow prettier to improve comments
1 parent 29c6bbf commit f2a2c56

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

exercises/phone-number/canonical-data.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,21 @@
9595
"error": "letters not permitted"
9696
}
9797
},
98+
{
99+
"uuid": "eb8a1fc0-64e5-46d3-b0c6-33184208e28a",
100+
"reimplements": "63f38f37-53f6-4a5f-bd86-e9b404f10a60",
101+
"comments": [
102+
"make input invalid only due to letters; area code may not start with 1"
103+
],
104+
"description": "invalid with letters",
105+
"property": "clean",
106+
"input": {
107+
"phrase": "523-abc-7890"
108+
},
109+
"expected": {
110+
"error": "letters not permitted"
111+
}
112+
},
98113
{
99114
"uuid": "4bd97d90-52fd-45d3-b0db-06ab95b1244e",
100115
"description": "invalid with punctuations",
@@ -106,6 +121,21 @@
106121
"error": "punctuations not permitted"
107122
}
108123
},
124+
{
125+
"uuid": "065f6363-8394-4759-b080-e6c8c351dd1f",
126+
"reimplements": "4bd97d90-52fd-45d3-b0db-06ab95b1244e",
127+
"comments": [
128+
"make input invalid only due to punctuation; area code may not start with 1"
129+
],
130+
"description": "invalid with punctuations",
131+
"property": "clean",
132+
"input": {
133+
"phrase": "523-@:!-7890"
134+
},
135+
"expected": {
136+
"error": "punctuations not permitted"
137+
}
138+
},
109139
{
110140
"uuid": "d77d07f8-873c-4b17-8978-5f66139bf7d7",
111141
"description": "invalid if area code starts with 0",

0 commit comments

Comments
 (0)