-
-
Notifications
You must be signed in to change notification settings - Fork 735
Fix test name for binary search exercise #2883
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
kahgoh
merged 2 commits into
exercism:main
from
akmaekki:2881_java_improve_tests_for_binary_search
Dec 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can revert this again, but the test name suggests to me that right boundary (maximum) is less than the left boundary (minimum).
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @akmaekki, the data for the tests comes from the problem specifications. As far as I can tell, the
List.of(1, 2)
matches the problem specification and so does the name. I think the name may be referring to way binary search works - left and right starts at the end and beginning of the list. At each step, compare the value you're looking for and update the "left" and "right" indexes depending on the comparison result. Repeat. If the value isn't in the list, the "left" and "right" will eventually cross over. Although, I'm little unsure why the value 0 is chosen as the value to find - it looks like the same case asaValueSmallerThanTheArraysSmallestValueIsNotFound
.If you feel there is still something wrong with the data for this test and would like to change, could you please open a discussion in the forums? Generally, we should fix the data in the problem specifications so that it can eventually be fixed in all tracks with this exercise, but we usually discuss changes to the problem specifications in the forums first.
The change to the other test method is fine because the change still matches the problem specifications. For this PR, I'd suggest backing this out for now to unblock it. If we agree to fix it in the forums, we can also do another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kahgoh
Thanks for the elaborate discussion and tip with the forum. I am fine with backing this out. Will remove the changes done on
nothingIsFoundWhenTheLeftAndRightBoundCross
and refresh this PR.