Skip to content

Check that every test input clones without changes - #169

Merged
virzak merged 1 commit into
masterfrom
test/identity-clone
Sep 12, 2026
Merged

virzak merged 1 commit into
masterfrom
test/identity-clone

Conversation

@virzak

@virzak virzak commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Every test now also clones each method it synchronizes through IdentityRewriter, a CloningRewriter that only renames the method, and fails with "Identity clone does not compile" if a clone doesn't. That separates bugs in the Cloning/ layer from bugs in the async to sync rules. No existing input fails and no snapshot changes.

The pass also fails if it clones fewer methods than were synchronized, so cloning nothing can't pass. The generator gets InternalsVisibleTo for Generator.Tests.

Generated with Claude Code

Every test now also runs an identity transformation over its source:
IdentityCloneGenerator copies each method the sync generator would
synchronize through IdentityRewriter, a CloningRewriter which changes
nothing but the method's name, and the test fails if a copy does not
compile. A failure there is in the Cloning layer - qualification,
usings, containing types, directives - rather than in the async to
sync rules, which the snapshot tests cannot tell apart.

The pass also fails when it clones fewer methods than were
synchronized, so that cloning nothing cannot pass for cloning
correctly.

The generator exposes its internals to Generator.Tests for this.

Generated with Claude Code
@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.37%. Comparing base (ff8281b) to head (58ac680).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #169      +/-   ##
==========================================
+ Coverage   92.26%   92.37%   +0.11%     
==========================================
  Files          15       15              
  Lines        1706     1706              
  Branches      391      391              
==========================================
+ Hits         1574     1576       +2     
+ Misses         48       46       -2     
  Partials       84       84              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@virzak
virzak merged commit 07dd354 into master Sep 12, 2026
10 checks passed
@virzak
virzak deleted the test/identity-clone branch September 12, 2026 17:16
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.

1 participant