Skip to content

[Repo Assist] test: expand GenerateAnonRecordStub and IntroduceMissingBinding coverage#1528

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-improvements-anon-record-missing-binding-20260411-3a596a57d1f6f654
Draft

[Repo Assist] test: expand GenerateAnonRecordStub and IntroduceMissingBinding coverage#1528
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-improvements-anon-record-missing-binding-20260411-3a596a57d1f6f654

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist.

Summary

This PR expands test coverage for two code fixes that had minimal test suites:

  • GenerateAnonRecordStub: Added 3 new test cases (was 3 → now 6 total)

    • Type-annotated let binding (let x: {| ... |} syntax)
    • Trailing whitespace before |} closing delimiter
    • Match arm context (fix applies in match expressions)
  • IntroduceMissingBinding: Added 4 new test cases (was 3 → now 7 total)

    • Does NOT apply to qualified names (Module.unknownFunc) — checkNotApplicable
    • Deeply nested context (let inside let inside let)
    • Expression context (let x = unknownFunc + 1)
    • Renamed existing tests for clarity

Root Cause / Rationale

These two code fixes had only 3 tests each, leaving many code paths and contexts untested. The new tests exercise the guards in IntroduceMissingBinding (qualified name check) and the regex parsing in GenerateAnonRecordStub (type-annotated and match arm variants).

Trade-offs

Pure test additions — no production code changes. The nested anonymous record scenario was investigated but found to be a pre-existing limitation (the fix applies to the outermost containing anon record, not the inner one where the diagnostic fires).

Test Status

✅ All tests pass — dotnet test -f net8.0 succeeded with no failures
✅ Build succeeds with no new errors or warnings
✅ Code is already well-formatted (fantomas check passes)

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@7ee2b60744abf71b985bead4599640f165edcd93

Add 4 new test cases for GenerateAnonRecordStub:
- type-annotated let binding context
- trailing whitespace before closing '|}'
- match arm context
- (total: 7 tests, up from 3)

Add 4 new test cases for IntroduceMissingBinding:
- qualified names should not trigger the fix
- deeply nested context with multiple let scopes
- identifier used in expression context
- (total: 7 tests, up from 3)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants