two-bucket: test inability to reach the goal#870
Merged
petertseng merged 2 commits intoexercism:masterfrom Sep 10, 2019
petertseng:bucket-impossible
Merged
two-bucket: test inability to reach the goal#870petertseng merged 2 commits intoexercism:masterfrom petertseng:bucket-impossible
petertseng merged 2 commits intoexercism:masterfrom
petertseng:bucket-impossible
Conversation
Preparing for cases where reaching the goal is impossible.
The student solution would need to employ one of several strategies: * (If searching the state space) Notice that there are no further states to be visited, and yet the solution has not been reached. * Notice that the goal is not divisible by the GCD of the bucket sizes, therefore can be rejected immediately. In case the student assumes that all non-coprime bucket counts will invalidate the goal, a counterexample to that is given as well (buckets not coprime but goal is still possible). There are ten implementing tracks: bash csharp fsharp go java javascript python ruby rust typescript Of these tracks, only two of them (Bash, Go) currently test the condition where it is not possible to reach the goal. Having this test serves as a reminder that it remains wise to handle the situation where a search has not found its goal. exercism/problem-specifications#1580
coriolinus
approved these changes
Sep 9, 2019
Member
coriolinus
left a comment
There was a problem hiding this comment.
Note: I haven't done a line-by-line code review of anything except tests/two-bucket.rs. If CI passes, then all tests pass, which means that src/lib.rs and example.rs have both been appropriately modified.
That said, this looks like a good change to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The student solution would need to employ one of several strategies:
to be visited, and yet the solution has not been reached.
therefore can be rejected immediately.
In case the student assumes that all non-coprime bucket counts will
invalidate the goal, a counterexample to that is given as well (buckets
not coprime but goal is still possible).
There are ten implementing tracks:
bash csharp fsharp go java javascript python ruby rust typescript
Of these tracks, only two of them (Bash, Go) currently test the
condition where it is not possible to reach the goal.
Having this test serves as a reminder that it remains wise to handle the
situation where a search has not found its goal.
exercism/problem-specifications#1580
Completely indifferent as to whether commits are squashed. In the case of no opinions, I will choose not to.