Skip to content

Add tests for Range.mapToUnitScale - #28

Merged
barrybecker4 merged 1 commit into
masterfrom
cursor/range-map-to-unit-scale-tests-a318
Nov 8, 2026
Merged

barrybecker4 merged 1 commit into
masterfrom
cursor/range-map-to-unit-scale-tests-a318

Conversation

@barrybecker4

Copy link
Copy Markdown
Member

Adds coverage for Range.mapToUnitScale in RangeSuite and documents the previously untested edge cases in scaladoc.

Tests

  • Typical mapping: Range(2, 6) maps min → 0, max → 1, midpoint → 0.5
  • Zero extent: when min == max, every value maps to 0 (no divide-by-zero)
  • Empty/undefined Range(): mapToUnitScale returns NaN

Docs

  • Scaladoc on mapToUnitScale now records the zero-extent and empty/NaN behaviors above

No behavioral changes to Range itself.

Fixes #16

Open in Web Open in Cursor 

Pin typical unit-scale mapping, zero-extent returning 0, and empty
NaN Range mapping to NaN, and document those behaviors in scaladoc.

Co-authored-by: Barry G Becker <barrybecker4@yahoo.com>
@barrybecker4
barrybecker4 merged commit 1c35aac into master Nov 8, 2026
1 check passed
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.

Add tests for Range.mapToUnitScale, including zero extent

2 participants