Write random contract tests and fix implementations to pass them

This commit is contained in:
Ilya Gorbunov
2018-07-04 06:42:19 +03:00
parent ed1f869354
commit b96803248f
5 changed files with 411 additions and 13 deletions
@@ -16,5 +16,7 @@ internal class PlatformThreadLocalRandom : kotlin.random.AbstractPlatformRandom(
override fun nextLong(bound: Long): Long = ThreadLocalRandom.current().nextLong(bound)
override fun nextLong(origin: Long, bound: Long): Long = ThreadLocalRandom.current().nextLong(origin, bound)
override fun nextDouble(bound: Double): Double = ThreadLocalRandom.current().nextDouble(bound)
override fun nextDouble(origin: Double, bound: Double): Double = ThreadLocalRandom.current().nextDouble(origin, bound)
// do not delegate this, as it's buggy in JDK8+ (up to 11 at the moment of writing)
// override fun nextDouble(origin: Double, bound: Double): Double = ThreadLocalRandom.current().nextDouble(origin, bound)
}