test: cover prototype and template generator branches#466
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 expands TinyBDD test coverage for PatternKit’s source generators, specifically targeting previously uncovered emission branches in the Prototype and Template generators (per #413’s coverage goals).
Changes:
- Adds a PrototypeGenerator scenario covering shallow-copy emission for arrays (
Clone()) and collection copy constructors. - Adds a TemplateGenerator scenario covering
GenerateAsync + ForceAsyncwith synchronous steps, hooks, andHandleAndContinueerror policy, validating the async emission path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/PatternKit.Generators.Tests/TemplateGeneratorTests.cs | Adds a scenario asserting async template emission (including hooks + try/catch) when ForceAsync is enabled with synchronous steps and error handling. |
| test/PatternKit.Generators.Tests/PrototypeGeneratorTests.cs | Adds a scenario asserting shallow-copy emission for arrays and collections (array Clone() + collection copy constructor). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results 12 files 12 suites 6m 45s ⏱️ Results for commit cd472d0. |
🔍 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 #466 +/- ##
==========================================
+ Coverage 96.99% 97.12% +0.12%
==========================================
Files 579 579
Lines 47156 47156
Branches 3091 6759 +3668
==========================================
+ Hits 45738 45798 +60
+ Misses 1418 1358 -60
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:
|
Code Coverage |
Refs #413.
Summary
Validation
dotnet test test\PatternKit.Generators.Tests\PatternKit.Generators.Tests.csproj --configuration Release -p:TestTfmsInParallel=false --filter "FullyQualifiedName~ShallowPrototype_CopiesArraysAndCollections|FullyQualifiedName~ForceAsync_Template_GeneratesAsyncPathForSynchronousSteps"dotnet test test\PatternKit.Generators.Tests\PatternKit.Generators.Tests.csproj --configuration Release -p:TestTfmsInParallel=false --collect:"XPlat Code Coverage" --results-directory TestResults-generators-current -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura