[repo-assist] test: add Parse/TryParse and Round invalid-mode coverage - #216
Draft
github-actions[bot] wants to merge 1 commit into
Draft
[repo-assist] test: add Parse/TryParse and Round invalid-mode coverage#216github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Adds FixedPointNanoParseTests.cs with 24 tests covering: - Parse(string) with valid, negative, and zero values - Parse(string) throws FormatException on invalid input - Parse(string) throws ArgumentNullException for null - Parse(ReadOnlySpan<char>) valid and invalid cases - TryParse(string?, IFormatProvider, out) — true/false cases including null, invalid, and out-of-range values - TryParse(string?, out) — invariant culture shorthand - TryParse(ReadOnlySpan<char>, IFormatProvider, out) — valid and invalid - TryParse(ReadOnlySpan<char>, out) — invariant culture shorthand - Round with invalid MidpointRounding mode throws ArgumentOutOfRangeException - Parse/TryParse round-trip with 6 test case values 1426 → 1450 tests passing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Adds 24 new tests covering
Parse,TryParse, andRoundwith an invalidMidpointRoundingmode — all of which previously had zero test coverage.Background
A code-coverage audit found that the entire
Parse/TryParseAPI surface was untested. These are important entry points: they acceptstring,ReadOnlySpan<char>,string?, and variousNumberStyles/IFormatProvideroverloads, plus error paths. TheRoundmethod's guard for an unsupportedMidpointRoundingenum value was also untested.New file:
FixedPointNanoParseTests.csParse(string)— happy-path valuesParse(ReadOnlySpan<char>)Parsewith explicitNumberStyles/ cultureParseinvalid input →FormatExceptionTryParse(string, out)— valid + invalid + nullTryParse(ReadOnlySpan<char>, out)TryParsewithNumberStyles/ cultureRound— invalidMidpointRoundingmodeTest Status
Build: ✅ Tests: ✅ (1426 → 1450, +24 new tests, 0 failures)
Add this agentic workflows to your repo
To install this agentic workflow, run