test: harden interpreter and observer generator coverage#478
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
Adds targeted generator test coverage for the Interpreter and Observer source generators to push line coverage toward 99% (refs #413). The Interpreter test asserts PKINT003 is reported for each of six distinct invalid rule shapes (blank name, void return, generic method, missing parameters, wrong non-terminal first parameter, wrong context type), exercising every branch in TryGetRule. The Observer test asserts that out-of-range enum values for Threading, Exceptions, and Order silently fall back to the documented defaults (Locking / Continue / RegistrationOrder) by checking the generated source shape.
Changes:
- New Interpreter test covering all
PKINT003invalid-rule branches in a single compilation. - New Observer test covering invalid-enum fallback behavior via generated-source assertions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/PatternKit.Generators.Tests/InterpreterGeneratorTests.cs | Adds ReportsDiagnosticsForInvalidInterpreterRuleShapes asserting six PKINT003 diagnostics. |
| test/PatternKit.Generators.Tests/ObserverGeneratorTests.cs | Adds Invalid_Enum_Configuration_Falls_Back_To_Observer_Defaults verifying default Locking/Continue source shape. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results 12 files 12 suites 11m 57s ⏱️ Results for commit c2a70f8. |
Code Coverage |
🔍 PR Validation ResultsVersion: `` ✅ Validation Steps
📊 ArtifactsDry-run artifacts have been uploaded and will be available for 7 days. This comment was automatically generated by the PR validation workflow. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #478 +/- ##
==========================================
+ Coverage 97.28% 97.38% +0.10%
==========================================
Files 579 579
Lines 47188 47188
Branches 3076 6772 +3696
==========================================
+ Hits 45906 45954 +48
+ Misses 1282 1234 -48
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Refs #413
Verification
ObserverGeneratorTests|FullyQualifiedNameInterpreterGeneratorTests"