Skip to content

test: make ControlChart toString tests JS-compatible#114

Merged
devcrocod merged 1 commit intomasterfrom
fix/js-controlchart-tostring-tests
Apr 23, 2026
Merged

test: make ControlChart toString tests JS-compatible#114
devcrocod merged 1 commit intomasterfrom
fix/js-controlchart-tostring-tests

Conversation

@devcrocod
Copy link
Copy Markdown
Member

Description

On Kotlin/JS Double.toString() drops the trailing .0 for whole-number doubles
((0.0).toString() == "0", (10.0).toString() == "10"), unlike JVM.
DoubleArray.contentToString() inherits this, so the two ControlChartTest cases
that asserted literal "0.0" / "10.0" substrings failed on jsNodeTest and
jsBrowserTest. Replace whole-number seed values in the affected fixtures with
non-zero-fraction values that format identically on both platforms, and add a
short note so the trap does not get re-set. Production toString() is unchanged.

Testing

./gradlew :kstats-core:jvmTest :kstats-core:jsNodeTest :kstats-core:jsBrowserTest
(full ControlChartTest green on all three targets)

Checklist

  • Existing tests pass
  • New/updated tests for changed behavior
  • New/updated documentation if necessary

On Kotlin/JS `Double.toString()` drops the trailing `.0` for whole-number
doubles (`(0.0).toString() == "0"`, `(10.0).toString() == "10"`), unlike
JVM. `DoubleArray.contentToString()` inherits this, so literal assertions
on `"0.0"` / `"10.0"` substrings failed on jsNodeTest and jsBrowserTest.

Replace whole-number seed values in the two affected fixtures with
non-zero-fraction values that format identically on both platforms, and
add a short note so the trap does not get re-set.
@devcrocod devcrocod merged commit 3eecc49 into master Apr 23, 2026
2 checks passed
@devcrocod devcrocod deleted the fix/js-controlchart-tostring-tests branch April 23, 2026 22:27
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