Skip to content

[repo-assist] test: add coverage-gap tests for Frac, Pow, Divide, and Clamp - #224

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/test-coverage-gaps-2026-07-13-d5ab90442c7cfbf5
Draft

[repo-assist] test: add coverage-gap tests for Frac, Pow, Divide, and Clamp#224
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/test-coverage-gaps-2026-07-13-d5ab90442c7cfbf5

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Adds 9 new tests in a new FixedPointNanoCoverageGapTests fixture that cover four behaviours which had no direct test coverage:

Gap New tests
Frac 5 — fractional part for positive, negative, exact integer, zero; parity check vs FractionalPart
Pow negative exponent 2 — throws ArgumentOutOfRangeException; zero exponent returns One
Divide(FixedPointNano, long) zero divisor 1 — throws DivideByZeroException
Clamp min > max 1 — throws ArgumentException

Why these gaps?

  • Frac is a public static method whose implementation is identical to FractionalPart, but it had no test of its own. It could silently diverge in future without any test catching it.
  • Pow(-1) guard branch existed in the source but was never exercised by the existing PowMatchesDecimalReference cases (all used non-negative exponents).
  • Divide(long, 0L) — the int overload zero-divisor path was tested; the long overload was not, even though it is a separate code path.
  • Clamp(min > max) — the ArgumentException guard was present but untested.

Test Status

Passed!  - Failed: 0, Passed: 1435, Skipped: 0, Total: 1435

All 1435 tests pass (9 added, 1426 pre-existing).

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Add this agentic workflows to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@e15e57b40918dbca11b350c55d02ab61934afa75

- Frac: 5 tests (fractional parts for positive, negative, integer, zero;
  and parity check against FractionalPart)
- Pow: negative-exponent guard (ArgumentOutOfRangeException) and
  zero-exponent returns One
- Divide(long): zero-divisor guard (DivideByZeroException)
- Clamp: min-exceeds-max guard (ArgumentException)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants