Refactor: extract JVM-specific tests into separate files

Make KotlinVersion random comparison test running in JS
This commit is contained in:
Ilya Gorbunov
2018-03-21 18:52:00 +03:00
parent 2d099a29b8
commit 7a40b4c5f1
12 changed files with 260 additions and 204 deletions
@@ -1,5 +1,6 @@
package test.utils
import test.randomInt
import kotlin.test.*
@@ -55,10 +56,8 @@ class KotlinVersionTest {
}
}
@JvmVersion // until there's random in JS
@Test fun randomVersionComparison() {
val random = java.util.Random()
fun randomComponent(): Int = random.nextInt(KotlinVersion.MAX_COMPONENT_VALUE + 1)
fun randomComponent(): Int = randomInt(KotlinVersion.MAX_COMPONENT_VALUE + 1)
fun randomVersion() = KotlinVersion(randomComponent(), randomComponent(), randomComponent())
repeat(1000) {
val v1 = randomVersion()