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

Fix to off-by-one for TopK and related test cases #24

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

jonahharris
Copy link
Contributor

After playing with the TopK example, I realized the output was not as expected. After looking into this, it's because the iteration used to pull the items out of the heap was using an improper lower bound index of greater than zero. The test cases passed because they only evaluated in comparison to the expected values by order of those returned by TopK instead of using the expected as the baseline, which meant the missing value was not found in the test cases. Accordingly, I updated the test cases to include the actual vs. expected length of the .values() and .iterator(). Likewise, iterator was being used in the first values test case, which was also incorrect.

@Callidon Callidon merged commit b267f92 into Callidon:master Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants