Skip to content

fix(deletion-rationale): a merge that compares another operand is a removal - #920

Merged
orieg merged 3 commits into
mainfrom
fix/merged-test-operands
Oct 29, 2026
Merged

orieg merged 3 commits into
mainfrom
fix/merged-test-operands

Conversation

@orieg

@orieg orieg commented Oct 29, 2026

Copy link
Copy Markdown
Owner

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:

  • the container kept the tests' assertion counts;
  • it kept their literal expected values.

A merge that changed a non-literal operand (toBe(one) to toBe(two)) was therefore not reported, though 0.27.0 reported it as a removal.

merged_into_container now 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:

No finding kind, configuration key or directive is added.

Evidence (RUN)

  • Real PRs:

  • Evasion corpus: js-merged-test-operand-changed is now caught as deletion-rationale/test-removed-without-rationale, and tests/test_evasion_corpus.rs passes.

  • End-to-end: the new a_merge_that_compares_another_operand_is_a_removal test runs a merge with no literals. One that keeps both operands passes, as the negative control. One that compares l(one) with two reports build > 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) to toBe(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 --check and cargo clippy --all-targets -- -D warnings are clean.
    • discipline docs --check and tests/action/check-links.py pass.
    • The full cargo test runs alongside CI.

Not run

No consumer replay was run. It runs at the 0.28.0 bump.

…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
orieg enabled auto-merge (squash) October 29, 2026 06:38
@orieg
orieg merged commit 887ed36 into main Oct 29, 2026
27 checks passed
@orieg
orieg deleted the fix/merged-test-operands branch October 29, 2026 07:53
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.

deletion-rationale: a merge into the container test that changes a non-literal operand is not reported

1 participant