Skip to content

Commit 85da7a5

Browse files
sdublishrpottsoh
authored andcommitted
largest-series-product: testdata to have standard error indicators (#1331)
1 parent 84aa479 commit 85da7a5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

exercises/largest-series-product/canonical-data.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"exercise": "largest-series-product",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"comments": [
5-
"A negative expected value means the input is invalid.",
6-
"Different languages may handle this differently.",
5+
"Different languages may handle errors differently.",
76
"e.g. raise exceptions, return (int, error), return Option<int>, etc.",
87
"Some languages specifically test the string->digits conversion",
98
"and the 'slices of size N' operation.",
@@ -102,7 +101,7 @@
102101
"digits": "123",
103102
"span": 4
104103
},
105-
"expected": -1
104+
"expected": {"error": "span must be smaller than string length"}
106105
},
107106
{
108107
"comments": [
@@ -147,7 +146,7 @@
147146
"digits": "",
148147
"span": 1
149148
},
150-
"expected": -1
149+
"expected": {"error": "span must be smaller than string length"}
151150
},
152151
{
153152
"description": "rejects invalid character in digits",
@@ -156,7 +155,7 @@
156155
"digits": "1234a5",
157156
"span": 2
158157
},
159-
"expected": -1
158+
"expected": {"error": "digits input must only contain digits"}
160159
},
161160
{
162161
"description": "rejects negative span",
@@ -165,7 +164,7 @@
165164
"digits": "12345",
166165
"span": -1
167166
},
168-
"expected": -1
167+
"expected": {"error": "span must be greater than zero"}
169168
}
170169
]
171170
}

0 commit comments

Comments
 (0)