Skip to content

largest-series-product: Canonical-data now has standard error indicators #1331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions exercises/largest-series-product/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"exercise": "largest-series-product",
"version": "1.1.0",
"version": "1.2.0",
"comments": [
"A negative expected value means the input is invalid.",
"Different languages may handle this differently.",
"Different languages may handle errors differently.",
"e.g. raise exceptions, return (int, error), return Option<int>, etc.",
"Some languages specifically test the string->digits conversion",
"and the 'slices of size N' operation.",
Expand Down Expand Up @@ -102,7 +101,7 @@
"digits": "123",
"span": 4
},
"expected": -1
"expected": {"error": "span must be smaller than string length"}
},
{
"comments": [
Expand Down Expand Up @@ -147,7 +146,7 @@
"digits": "",
"span": 1
},
"expected": -1
"expected": {"error": "span must be smaller than string length"}
},
{
"description": "rejects invalid character in digits",
Expand All @@ -156,7 +155,7 @@
"digits": "1234a5",
"span": 2
},
"expected": -1
"expected": {"error": "digits input must only contain digits"}
},
{
"description": "rejects negative span",
Expand All @@ -165,7 +164,7 @@
"digits": "12345",
"span": -1
},
"expected": -1
"expected": {"error": "span must be greater than zero"}
}
]
}