[KLIB][tests] Keep "klib evolution" test data under "testData/klib/" dir

This commit is contained in:
Dmitriy Dolovov
2023-08-15 14:47:24 +02:00
committed by Space Team
parent d7e9fcea04
commit 60b950b9bd
46 changed files with 173 additions and 174 deletions
@@ -0,0 +1,50 @@
// MODULE: lib
// FILE: A.kt
// VERSION: 1
open class X {
private fun foo() = "private in super"
fun bar() = foo()
private val zeg = "private in super"
fun lim() = zeg
}
// FILE: B.kt
// VERSION: 2
open class X {
public fun foo() = "public in super"
fun bar() = foo()
private val zeg = "public in super"
fun lim() = zeg
}
// MODULE: mainLib(lib)
// FILE: mainLib.kt
class Y: X() {
private fun foo() = "private in derived"
fun qux() = foo()
private val zeg = "private in derived"
fun tes() = zeg
}
fun lib(): String = when {
X().bar() != "public in super" -> "fail 1"
Y().bar() != "public in super" -> "fail 2"
Y().qux() != "private in derived" -> "fail 3"
X().lim() != "public in super" -> "fail 4"
Y().lim() != "public in super" -> "fail 5"
Y().tes() != "private in derived" -> "fail 6"
else -> "OK"
}
// MODULE: main(mainLib)
// FILE: main.kt
fun box(): String = lib()