test: harden composite and flyweight generator coverage#476
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 strengthens source-generator coverage for Composite and Flyweight scenarios, and updates Composite generation for abstract-class contracts.
Changes:
- Adds Flyweight tests for omitted
TryGet, duplicate factories, cache-name conflicts, and invalid factory signatures. - Adds Composite tests for abstract-class contracts with custom names, ignored properties, unsupported events, and generated-name conflicts.
- Updates Composite output to emit
abstract overridefor abstract-class contract properties.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/PatternKit.Generators/Composite/CompositeGenerator.cs |
Adjusts generated property declarations for abstract-class Composite contracts. |
test/PatternKit.Generators.Tests/CompositeGeneratorTests.cs |
Adds Composite generator coverage for custom names and diagnostics. |
test/PatternKit.Generators.Tests/FlyweightGeneratorTests.cs |
Adds Flyweight generator coverage for emission branches and diagnostics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| sb.Append(component.TypeKind == TypeKind.Class ? " public abstract override " : " public abstract ") | ||
| .Append(property.Type.ToDisplayString(TypeFormat)).Append(' ').Append(property.Name).Append(" { get; }").AppendLine(); |
Test Results 12 files 12 suites 10m 38s ⏱️ Results for commit d4bd44e. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #476 +/- ##
==========================================
+ Coverage 97.24% 97.36% +0.11%
==========================================
Files 579 579
Lines 47187 47188 +1
Branches 3079 6772 +3693
==========================================
+ Hits 45889 45946 +57
+ Misses 1298 1242 -56
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. |
Code Coverage |
Summary
Refs #413
Verification
FlyweightGeneratorTests|FullyQualifiedNameCompositeGeneratorTests"