test: raise Humanizer coverage above 99 percent#1727
Conversation
e18aad5 to
ffab869
Compare
There was a problem hiding this comment.
Pull request overview
Adds targeted tests and small generator refactors to push Humanizer’s line coverage above 99%, while also normalizing formatting in touched test files.
Changes:
- Added new “coverage gap” tests exercising fallback/edge branches across converters, truncation, registries, and formatter behaviors.
- Added reflection-based tests to cover the generated FluentDate API surface (including DateOnly/TimeOnly paths behind TFMs).
- Refactored token-map source-generator emission helpers to reduce per-locale branching; normalized EOF/style in a few test files.
Reviewed changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Humanizer.Tests/Localisation/ur/UrduListHumanizeTests.cs | EOF/style normalization only. |
| tests/Humanizer.Tests/Localisation/FormatterExactOutputTests.cs | EOF/style normalization only. |
| tests/Humanizer.Tests/FluentDate/GeneratedFluentDateTests.cs | New tests reflecting over FluentDate generated API surface. |
| tests/Humanizer.Tests/CoverageGapTests.cs | New broad set of focused tests covering previously-unhit branches. |
| tests/Humanizer.Tests/CollectionHumanizeTests.cs | EOF/style normalization only. |
| tests/Humanizer.SourceGenerators.Tests/SourceGenerators/HumanizerSourceGeneratorTests.cs | Renamed cached generated source field to match naming rules; updated references. |
| src/Humanizer.SourceGenerators/Generators/TokenMapWordsToNumberInput.cs | Refactored generator emission to use helper for “true” booleans and simplified long emission for ScaleThreshold. |
| src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/WordsToNumberEngineContractFactory.cs | Refactored token-map rules expression generation to reduce per-field branching and centralize literal formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ffab869 to
96cc506
Compare
96cc506 to
9579448
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9579448 to
e228ba4
Compare
e228ba4 to
661e1fd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
661e1fd to
18bcca9
Compare
|
Follow-up pushed in Coverage/complexity checkpoint from local
Validation run locally:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 16 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Follow-up pushed in Coverage/branch checkpoint from local
What changed:
Validation run locally:
|
|
Follow-up pushed in Coverage/branch checkpoint from local
What changed:
Validation run locally:
Note: a plain local |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 22 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Follow-up pushed in Coverage/branch checkpoint from local Cobertura:
What changed:
Validation run locally:
GitHub checks are running on the new SHA now. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 29 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 30 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Tests
dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net10.0 -c Release -- --coverage --coverage-output-format cobertura(99.0006% line coverage)dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net11.0 -c ReleaseDOTNET_ROLL_FORWARD=Major dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net8.0 -c Releasedotnet test tests/Humanizer.SourceGenerators.Tests/Humanizer.SourceGenerators.Tests.csproj -c Releasedotnet format Humanizer.slnx --verify-no-changes --verbosity diagnosticdotnet pack src/Humanizer/Humanizer.csproj -c Release -o artifacts/package-validationpwsh tests/verify-packages.ps1 -PackageVersion 3.5.0-preview.2.g30d00a7bd9 -PackagesDirectory artifacts/package-validationNotes
net8.0test launch is blocked on this machine becauseMicrosoft.NETCore.App 8.0.0is not installed; thenet8.0target was also run withDOTNET_ROLL_FORWARD=Major.net48tests were not run because this is not a Windows host.