Repository navigation
test: harden prototype generator coverage - #469
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
This PR increases PrototypeGenerator test coverage (TinyBDD scenarios) and adjusts immutability detection for System.Collections.Immutable types to be less dependent on shorthand symbol display strings.
Changes:
- Added new
PrototypeGeneratorTestsscenarios covering mutable record/record struct construction branches, immutable-collection warning suppression, field inclusion, and shallow-copy reference fallback. - Hardened immutable namespace detection in
PrototypeGeneratorby using fully-qualified type display strings and a namespace-walk helper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
test/PatternKit.Generators.Tests/PrototypeGeneratorTests.cs |
Adds TinyBDD/xUnit scenarios to cover previously untested Prototype generator branches and warning behavior. |
src/PatternKit.Generators/PrototypeGenerator.cs |
Updates immutable reference-type detection logic for System.Collections.Immutable types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Check for known immutable collections (basic check) | ||
| var typeName = type.ToDisplayString(); | ||
| if (typeName.StartsWith("System.Collections.Immutable.", StringComparison.Ordinal)) | ||
| var typeName = type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); | ||
| if (typeName.Contains("System.Collections.Immutable.", StringComparison.Ordinal) || | ||
| IsInNamespace(type, "System.Collections.Immutable")) | ||
| return true; |
Test Results 12 files 12 suites 10m 45s ⏱️ Results for commit 678f55b. ♻️ This comment has been updated with latest results. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #469 +/- ##
==========================================
+ Coverage 97.05% 97.18% +0.12%
==========================================
Files 579 579
Lines 47180 47180
Branches 3086 6768 +3682
==========================================
+ Hits 45792 45850 +58
+ Misses 1388 1330 -58
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:
|
🔍 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. |
90c106b to
678f55b
Compare
Code Coverage |
Refs #413.
Summary
Validation
Local generator coverage: 97.46%; PrototypeGenerator coverage: 97.10%.