[Repo Assist] test: expand GenerateAnonRecordStub and IntroduceMissingBinding coverage#1528
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
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>
29 tasks
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.
🤖 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)let x: {| ... |}syntax)|}closing delimiterIntroduceMissingBinding: Added 4 new test cases (was 3 → now 7 total)Module.unknownFunc) —checkNotApplicablelet x = unknownFunc + 1)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 inGenerateAnonRecordStub(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.0succeeded with no failures✅ Build succeeds with no new errors or warnings
✅ Code is already well-formatted (fantomas check passes)