Skip to content

feat(measurement): enforce finite Distance magnitudes#599

Merged
mtrewartha merged 2 commits intomainfrom
finite-distances
Mar 8, 2026
Merged

feat(measurement): enforce finite Distance magnitudes#599
mtrewartha merged 2 commits intomainfrom
finite-distances

Conversation

@mtrewartha
Copy link
Copy Markdown
Owner

Summary

  • Add init block to Distance that throws IllegalArgumentException with a descriptive message when constructed with a NaN or infinite magnitude
  • Update DistanceTest to cover the new validation (three new cases: finite succeeds, NaN throws, infinite throws)
  • Fix all property-based tests that used Arb.double() (which can produce non-finite values) to use Arb.numericDouble() instead

Closes POS-29

Test plan

  • ./gradlew :core:measurement:test passes

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.64%. Comparing base (fd2da0d) to head (a83f964).
⚠️ Report is 1 commits behind head on main.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

mtrewartha and others added 2 commits March 8, 2026 12:24
Throw IllegalArgumentException when constructing a Distance with a NaN
or infinite magnitude. Update tests to cover the new validation and fix
all property-based tests that previously used Arb.double() (which can
produce non-finite values).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mtrewartha mtrewartha marked this pull request as ready for review March 8, 2026 17:38
@mtrewartha mtrewartha merged commit c4d67c9 into main Mar 8, 2026
4 checks passed
@mtrewartha mtrewartha deleted the finite-distances branch March 8, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant