Skip to content
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

change: Use error object instead of sentinel -1 #1340

Merged
merged 1 commit into from
Sep 24, 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
8 changes: 4 additions & 4 deletions exercises/change/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"exercise": "change",
"version": "1.2.0",
"version": "1.3.0",
"comments": [
"Given an infinite supply of coins with different values, ",
"find the smallest number of coins needed to make a desired ",
Expand Down Expand Up @@ -88,7 +88,7 @@
"coins": [5, 10],
"target": 3
},
"expected": -1
"expected": {"error": "can't make target with given coins"}
},
{
"description": "error if no combination can add up to target",
Expand All @@ -97,7 +97,7 @@
"coins": [5, 10],
"target": 94
},
"expected": -1
"expected": {"error": "can't make target with given coins"}
},
{
"description": "cannot find negative change values",
Expand All @@ -106,7 +106,7 @@
"coins": [1, 2, 5],
"target": -5
},
"expected": -1
"expected": {"error": "target can't be negative"}
}
]
}