Repository navigation
binary-search: make the stub signature match the tests - #602
Conversation
|
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
Summary
The
binary-searchstub declaresbut the tests and
.meta/example.zigcall it generically, asbinarySearch(T, target, items).So when a student runs the tests against the untouched stub, the first error comes from the test file, not the stub's "please implement" message:
The stub currently works around this with a comment ("Take a look at the tests, you might have to change the function arguments").
No other stub in the track has a comment like this.
The other generic exercises (
strain,linked-list,circular-buffer,complex-numbers) give thecomptime T: typesignature in the stub.This PR changes the stub to the signature the tests expect and removes the comment:
Testing
zig test test_binary_search.zigagainst the new stub fails only on the intended@compileError("please implement the binarySearch function").meta/example.zigstill passes all 11 tests (unchanged)zig fmt --checkpassesImpact on existing solutions
Only
binary_search.zig, the exercise'ssolutionfile, changes.No test, editor or invalidator files are touched, so merging this should not re-run existing student solutions.
Forum discussion: https://forum.exercism.org/t/binary-search-stub-function-signature-doesnt-match-the-tests/99761