The Wayback Machine - https://web.archive.org/web/20200516231654/https://github.com/scala-js/scala-js/issues/3706
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate upstream JUnit test scala/collection/immutable/NumericRangeTest.scala with 2.13.0 #3706

Open
sjrd opened this issue Jun 21, 2019 · 1 comment

Comments

@sjrd
Copy link
Member

@sjrd sjrd commented Jun 21, 2019

It was blacklisted in #3702/#2703, but it is unclear if it is caused by an actual bug in our implementation of BigDecimal or not at this point. We should investigate.

If someone wants to tackle this, use the following steps to reproduce:

  • Move the line scala/collection/immutable/NumericRangeTest.scala from scala-test-suite/src/test/resources/2.13.0/BlacklistedTests.txt to WhitelistedTests.txt

  • Run sbt, and inside run:

    > ++2.13.0
    > scalaTestSuite/test
    
@iPomme
Copy link

@iPomme iPomme commented Jun 27, 2019

The code from the test:

val aa = BigDecimal(1, new java.math.MathContext(40))
val bb = aa + BigDecimal("1e-30")
val c = BigDecimal("1e-38")

assert((aa to bb by c).drop(1).headOption == Some(BigDecimal("1." + "0" * 37 + "1")))

is running fine on Scala 2.13.0,
is running fine with Scala.js on 2.12.8
and is failing with Scala.js on 2.13 (java.lang.IllegalArgumentException: More than Int.MaxValue elements)

So, it might be a bug in the implementation of BigDecimal

@sjrd sjrd added the bug label Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.