James Eschner
04/02/2021, 1:14 PMArb.bigDecimal()
. Code:
class MyTest : ShouldSpec({
should("be able to use bigDecimal") {
// It would be great if Arb.bigDecimal() actually worked here :)
checkAll(Arb.bigDecimal()) { bigDecimal ->
true shouldBe true
}
}
})
~~~ Kotest Configuration ~~~
Character I is neither a decimal digit number, decimal point, nor "e" notation exponential mark.
java.lang.NumberFormatException: Character I is neither a decimal digit number, decimal point, nor "e" notation exponential mark.
at java.base/java.math.BigDecimal.<init>(BigDecimal.java:518)
MyTest > should be able to use bigDecimal FAILED
java.lang.NumberFormatException at MyTest.kt:33
Caused by: java.lang.NumberFormatException at MyTest.kt:33
If we look at the implementation of bigDecimal()
I can see why it’s failing, it’s simply taking Arb.double()
and calling the toBigDecimal()
extension function which fails on inputs like Double.NEGATIVE_INFINITY
and Double.POSITIVE_INFINITY
. Is this a bug or am I using Arb.bigDecimal()
incorrectly?
* Not a Contribution *Ashish Kumar Joy
04/02/2021, 1:42 PMJames Eschner
04/02/2021, 1:55 PM4.4.3
release, just pulled it and the test passes now. Thank you!
* Not a Contribution *Ashish Kumar Joy
04/02/2021, 1:57 PMJames Eschner
04/02/2021, 1:58 PMAshish Kumar Joy
04/02/2021, 2:00 PMchristophsturm
04/02/2021, 3:38 PM