Skip to content

Respect MaxDiff when ignoring slice order - #77

Merged
daniel-nichter merged 2 commits into
go-test:mainfrom
fly1d:fix/unordered-maxdiff
Oct 31, 2026
Merged

daniel-nichter merged 2 commits into
go-test:mainfrom
fly1d:fix/unordered-maxdiff

Conversation

@fly1d

@fly1d fly1d commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

FLAG_IGNORE_SLICE_ORDER can return more than MaxDiff differences: with the default limit of 10, two disjoint eight-element slices return 16.

Apply the budget in the value-count loop so both passes share the limit, including differences already found in earlier fields. Keep the existing zero-diff behavior for zero and negative limits, as requested in review. This follow-up changes one guard and the two nonpositive test expectations; the positive-limit, ordering and multiplicity controls remain unchanged.

Validation on Go 1.26.6, macOS arm64:

  • The same final 11-case fixture gives two nonpositive failures and nine passing controls on the previous PR head, then 11/11 with the repair.
  • Full go test ./..., go test -race ./..., go vet ./..., formatting and diff checks pass. Tests use existing tools with dependency/toolchain downloads disabled.
  • Main's separate complex-comparison change was checked for exact patch composition; no mechanical sync or combined-main runtime result is claimed.

The existing Go workflow filters master while this PR targets main; these are local results, not a hosted Go/platform-matrix result.

Comment thread deep_test.go Resolved
@daniel-nichter
daniel-nichter merged commit de159a0 into go-test:main Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants