Repository navigation
fix: exclude empty ranges from proptest_range_boundaries - #391
Merged
Merged
Conversation
With len = 0, the negative contains_range checks build empty ranges (e.g. 0..0 or 2..2). contains_range always returns true for an empty range, so those assertions can never pass. Require len >= 1 in both the RoaringBitmap and RoaringTreemap versions so every negative check covers start - 1 or end, neither of which is in the bitmap.
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.
With
len = 0, the negativecontains_rangechecks build empty ranges (e.g. 0..0 or 2..2).contains_rangealways returns true for an empty range, so those assertions can never pass. Require len >= 1 in both the RoaringBitmap and RoaringTreemap versions.Fixes the issue we happened to run into by chance in #388, we just got unlucky: the proptest regression file output (
cc 0822d47f23d48cb6b9c3bb1eb8cc603f294c7c416dbb9363b1221fe0c1cc499a) reproduces onmain, until this PR is merged.