Repository navigation
fix(deletion-rationale): a merge that compares another operand is a removal - #920
Merged
Merged
Conversation
…emoval (#915) merged_into_container read nested tests merged into a test named for their container as a merge when the container kept their counts and literal expected values, so a merge that changed a non-literal operand (toBe(one) to toBe(two)) was not reported. 0.27.0 reported it as a removal. The container must now also hold every equality operand of the tests it took over (TestFn::equality_operands, as a multiset of operand digests). vitejs/vite#23604 still reads as a merge; the corpus case js-merged-test-operand-changed is caught as deletion-rationale/test-removed-without-rationale. docs/GATES.md and the unreleased ledger row for #911 are updated in place. Closes #915 Signed-off-by: Nicolas Brousse <nicolas@brousse.info>
orieg
enabled auto-merge (squash)
October 29, 2026 06:38
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.
Closes #915.
What
The #911 merge rule (unreleased) read nested tests merged into a test named for their container as a merge in these conditions:
A merge that changed a non-literal operand (
toBe(one)totoBe(two)) was therefore not reported, though 0.27.0 reported it as a removal.merged_into_containernow also requires the container to hold every equality operand of the tests it took over. Operands are compared as a multiset of digests (TestFn::equality_operands, both the different-operand and the self-comparison lists).Docs:
docs/GATES.mdstates the new condition and drops the known-miss line.docs/ROADMAP.mdis updated in place.No finding kind, configuration key or directive is added.
Evidence (RUN)
Real PRs:
vitejs/vite#23604's real test file still reads as a merge (0 findings).Evasion corpus:
js-merged-test-operand-changedis nowcaughtasdeletion-rationale/test-removed-without-rationale, andtests/test_evasion_corpus.rspasses.End-to-end: the new
a_merge_that_compares_another_operand_is_a_removaltest runs a merge with no literals. One that keeps both operands passes, as the negative control. One that comparesl(one)withtworeportsbuild > b.Self-test: a new case, so 368 cases run, 0 failed.
Mutation: with the operand check off, the new e2e test and the corpus case both fail, then pass once it is restored.
A first e2e control (
toBe(1)totoBe(one)) did not kill the mutant, because the expected-value check already catches a lost literal. It was replaced by the literal-free test above.Checks:
cargo fmt --checkandcargo clippy --all-targets -- -D warningsare clean.discipline docs --checkandtests/action/check-links.pypass.cargo testruns alongside CI.Not run
No consumer replay was run. It runs at the 0.28.0 bump.