Repository navigation
Conversation
| a: []int{1, 2, 3}, b: []int{4, 5, 6}, | ||
| }, | ||
| { | ||
| name: "zero retains unordered behavior", limit: 0, wantCount: 6, |
Member
There was a problem hiding this comment.
This raises another issue: MaxDiff <= 0 actually produces zero diffs. That's the original because behaviour because, unfortunately, I never specified what happens if it's <= 0. So line 520 should be
if len(c.diff) >= MaxDiff {like original code, and this test changed to wantCount: 0. That would truly preserve original, undefined behaviour.
Thoughts?
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.
FLAG_IGNORE_SLICE_ORDERcan return more thanMaxDiffdifferences: withthe default limit of 10, two disjoint eight-element slices return 16.
Check the positive budget in the value-count loop so both passes share the
limit, including differences already found in earlier fields. Zero and
negative limits retain their existing unordered behavior. The original
tests are unchanged; 11 appended cases cover the limit and its controls.
The pending Differ work in #71 also retains the uncapped counting loop.
Validation on Go 1.26.6, macOS arm64:
all 11 pass with the fix.
go build, full tests with coverage,go vet ./..., andgo test -race ./...pass. Core package coverage is 100.0%.git diff --checkpass; modules and CI filesare unchanged.
The existing Go test workflow filters
masterwhile this targetsmain;these are local results, not a claim that the hosted Go/platform matrix ran.