Repository navigation
Add polyfills for char.IsBetween(...) and char.IsAscii*(...) - #129
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## prime #129 +/- ##
==========================================
+ Coverage 99.14% 99.15% +0.01%
==========================================
Files 143 145 +2
Lines 3727 3798 +71
Branches 87 87
==========================================
+ Hits 3695 3766 +71
Misses 13 13
Partials 19 19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds .NET 7 char static API polyfills (ASCII classification helpers and IsBetween) so consumers targeting older TFMs (netstandard, netframework, pre-.NET 7 netcoreapp) can call the newer char.* methods with the same surface area.
Changes:
- Introduces
Net70/Char.cspolyfills forchar.IsBetweenand thechar.IsAscii*family. - Adds
PolyShim.Tests/Net70/CharTests.csto validate the new polyfilled APIs across the test TFMs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| PolyShim/Net70/Char.cs | Adds .NET 7 char polyfill members (IsBetween / IsAscii / IsAscii*) behind appropriate TFM guards. |
| PolyShim.Tests/Net70/CharTests.cs | Adds unit tests covering the new char polyfills’ expected true/false cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot some methods were introduced in .NET 6 |
Moved
Moved |
char.IsBetween(...) and char.IsAscii*(...)
Polyfills for the
charstatic methods introduced in .NET 7, making them available on older targets (netstandard, netframework, pre-NET7 netcoreapp).New polyfills —
Net70/Char.cschar.IsBetween(c, min, max)char.IsAscii(c)(uint)c <= 0x7fchar.IsAsciiDigit(c)'0'–'9'char.IsAsciiLetter(c)char.IsAsciiLetterUpper(c)'A'–'Z'char.IsAsciiLetterLower(c)'a'–'z'char.IsAsciiLetterOrDigit(c)char.IsAsciiHexDigit(c)char.IsAsciiHexDigitUpper(c)'A'–'F'or digitchar.IsAsciiHexDigitLower(c)'a'–'f'or digit