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

binary-search: Use error object instead of sentinel -1 #1338

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
12 changes: 6 additions & 6 deletions exercises/binary-search/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"exercise": "binary-search",
"version": "1.1.0",
"version": "1.2.0",
"comments": [
"Here -1 is used to indicate that the value is not included in the array.",
"The error object is used to indicate that the value is not included in the array.",
"It should be replaced with the respective expression that is idiomatic",
"for the language that implements the tests.",

Expand Down Expand Up @@ -77,7 +77,7 @@
"array": [1, 3, 4, 6, 8, 9, 11],
"value": 7
},
"expected": -1
"expected": {"error": "value not in array"}
},
{
"description": "a value smaller than the array's smallest value is not included",
Expand All @@ -86,7 +86,7 @@
"array": [1, 3, 4, 6, 8, 9, 11],
"value": 0
},
"expected": -1
"expected": {"error": "value not in array"}
},
{
"description": "a value larger than the array's largest value is not included",
Expand All @@ -95,7 +95,7 @@
"array": [1, 3, 4, 6, 8, 9, 11],
"value": 13
},
"expected": -1
"expected": {"error": "value not in array"}
},
{
"description": "nothing is included in an empty array",
Expand All @@ -104,7 +104,7 @@
"array": [],
"value": 1
},
"expected": -1
"expected": {"error": "value not in array"}
}
]
}