Skip to content

test: compile the fixed code in the code-fix tests - #97

Merged
vbreuss merged 2 commits into
mainfrom
test/compile-fixed-code
Oct 31, 2026
Merged

vbreuss merged 2 commits into
mainfrom
test/compile-fixed-code

Conversation

@vbreuss

@vbreuss vbreuss commented Oct 18, 2026

Copy link
Copy Markdown
Member

The code-fix tests disabled compiler diagnostics, so a fix that produced invalid Mockolate code passed as long as the text matched. The verifier now reports compiler errors and runs the Mockolate source generator from the referenced package, so every known gap is an explicit {|CSxxxx:...|} expectation in the affected test.

  • Test sources live in namespace MyCode; because the generator skips types in the global namespace.
  • New tests pin the silent bail-outs: three-argument Verify, Received().Event += h, Received.InOrder and ReceivedWithAnyArgs() on a property (the NSubstitute ones compile but fail at runtime).
  • Surfaced errors: CS0104 It is ambiguous because using Moq; stays (most Moq tests); CS1929 on every nested chain mock.Child.Mock; CS1061/CS0411 on kept Verify/VerifyGet/VerifySet/VerifyAdd/VerifyRemove calls; CS0121 Bar(default, default) for *ForAnyArgs/*WithAnyArgs; CS1503/CS1593/CS1061/CS1615 in the CallInfo fallbacks; invalid inputs in six tests (CS1061, CS0411, CS1503, CS1660, CS1501).
  • The target-typed new() fix emits MyCode.IFoo.CreateMock() as a qualified name that does not round-trip, so that test skips the syntax-tree check.

@vbreuss vbreuss self-assigned this Oct 18, 2026
@vbreuss
vbreuss added this pull request to stack #99 October 18, 2026 18:22
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Test Results

 12 files   12 suites   1h 42m 32s ⏱️
298 tests 298 ✅ 0 💤 0 ❌
894 runs  894 ✅ 0 💤 0 ❌

Results for commit e8386af.

♻️ This comment has been updated with latest results.

Copilot AI balanced review requested due to automatic review settings October 18, 2026 23:46
@vbreuss
vbreuss force-pushed the test/compile-fixed-code branch from fee5001 to 33ae81c Compare October 18, 2026 23:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vbreuss
vbreuss force-pushed the test/compile-fixed-code branch from 33ae81c to a98ed83 Compare October 18, 2026 23:46
Base automatically changed from fix/todo-for-untranslated-constructs to main October 31, 2026 09:32
@vbreuss
vbreuss force-pushed the test/compile-fixed-code branch from a98ed83 to 3f47819 Compare October 31, 2026 09:35
Copilot AI balanced review requested due to automatic review settings October 31, 2026 09:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

The code-fix tests disabled compiler diagnostics, so a fix that produced invalid Mockolate code passed as long as the text matched. The verifier now reports compiler errors and runs the Mockolate source generator from the referenced package, so every known gap is an explicit `{|CSxxxx:...|}` expectation in the affected test.

- Test sources live in `namespace MyCode;` because the generator skips types in the global namespace.
- New tests pin the silent bail-outs: three-argument `Verify`, `Received().Event += h`, `Received.InOrder` and `ReceivedWithAnyArgs()` on a property (the NSubstitute ones compile but fail at runtime).
- Surfaced errors: CS0104 `It` is ambiguous because `using Moq;` stays (most Moq tests); CS1929 on every nested chain `mock.Child.Mock`; CS1061/CS0411 on kept `Verify`/`VerifyGet`/`VerifySet`/`VerifyAdd`/`VerifyRemove` calls; CS0121 `Bar(default, default)` for `*ForAnyArgs`/`*WithAnyArgs`; CS1503/CS1593/CS1061/CS1615 in the CallInfo fallbacks; invalid inputs in six tests (CS1061, CS0411, CS1503, CS1660, CS1501).
- The target-typed `new()` fix emits `MyCode.IFoo.CreateMock()` as a qualified name that does not round-trip, so that test skips the syntax-tree check.
@vbreuss
vbreuss force-pushed the test/compile-fixed-code branch from 3f47819 to e8386af Compare October 31, 2026 10:38
Copilot AI balanced review requested due to automatic review settings October 31, 2026 10:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@vbreuss
vbreuss enabled stacked auto-merge (squash) October 31, 2026 10:39
@sonarqubecloud

Copy link
Copy Markdown

@vbreuss
vbreuss merged commit d3bb6dd into main Oct 31, 2026
10 checks passed
@vbreuss
vbreuss deleted the test/compile-fixed-code branch October 31, 2026 10:51
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.

2 participants