JVM_IR: add a test for when(enum) binary compatibility

This commit is contained in:
pyos
2022-04-06 13:10:12 +02:00
committed by Alexander Udalov
parent 518a6dec8c
commit d61e7db937
5 changed files with 38 additions and 0 deletions
@@ -519,6 +519,17 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
.loadClass("SourceKt").getDeclaredMethod("run").invoke(null)
}
fun testChangedEnumsInLibrary() {
val oldLibrary = compileLibrary("old", checkKotlinOutput = {})
val newLibrary = compileLibrary("new", checkKotlinOutput = {})
compileKotlin("source.kt", tmpdir, listOf(oldLibrary))
val result =
URLClassLoader(arrayOf(newLibrary.toURI().toURL(), tmpdir.toURI().toURL()), ForTestCompileRuntime.runtimeJarClassLoader())
.loadClass("SourceKt").getDeclaredMethod("run").invoke(null) as String
assertEquals("ABCAB", result)
}
fun testClassFromJdkInLibrary() {
val library = compileLibrary("library")
compileKotlin("source.kt", tmpdir, listOf(library))