Add test on compiling against kotlin.stdlib.jdk7/8 on JDK 9
This commit is contained in:
committed by
Ilya Gorbunov
parent
2a8be2cdb4
commit
1592555783
@@ -0,0 +1 @@
|
||||
OK
|
||||
@@ -0,0 +1,15 @@
|
||||
import java.util.stream.Stream
|
||||
import kotlin.streams.*
|
||||
|
||||
// kotlin-stdlib-jdk7
|
||||
|
||||
fun testUse(c: AutoCloseable) = c.use {}
|
||||
|
||||
// kotlin-stdlib-jdk8
|
||||
|
||||
fun testGet(c: MatchGroupCollection) = c.get("")
|
||||
|
||||
fun testGetOrDefault(c: Map<out Number, Any>) = c.getOrDefault(42, "")
|
||||
fun testRemove(c: MutableMap<out Number, Any>) = c.remove(42, "")
|
||||
|
||||
fun testAsSequence(c: Stream<String>) = c.asSequence()
|
||||
@@ -0,0 +1,5 @@
|
||||
module usage {
|
||||
requires kotlin.stdlib;
|
||||
requires kotlin.stdlib.jdk7;
|
||||
requires kotlin.stdlib.jdk8;
|
||||
}
|
||||
@@ -38,6 +38,7 @@ class Java9ModulesIntegrationTest : AbstractKotlinCompilerIntegrationTest() {
|
||||
|
||||
val kotlinOptions = mutableListOf(
|
||||
"-jdk-home", jdk9Home.path,
|
||||
"-jvm-target", "1.8",
|
||||
"-Xmodule-path=$paths"
|
||||
)
|
||||
if (addModules.isNotEmpty()) {
|
||||
@@ -252,4 +253,8 @@ class Java9ModulesIntegrationTest : AbstractKotlinCompilerIntegrationTest() {
|
||||
module("namedWithExplicitDependency")
|
||||
module("namedWithoutExplicitDependency")
|
||||
}
|
||||
|
||||
fun testDependencyOnStdlibJdk78() {
|
||||
module("usage", listOf(File("dist/kotlinc/lib/kotlin-stdlib-jdk7.jar"), File("dist/kotlinc/lib/kotlin-stdlib-jdk8.jar")))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user