backend/tests: Add blackbox tests from Kotlin JVM

Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
This commit is contained in:
Ilya Matveev
2017-01-12 19:43:20 +07:00
parent d5988297b1
commit 1b553ebfaf
2643 changed files with 66666 additions and 0 deletions
@@ -0,0 +1,36 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_REFLECT
// FILE: J.java
public class J {
public static String x;
static String packageLocalField;
}
// FILE: K.kt
import kotlin.test.assertEquals
fun box(): String {
val f = J::x
assertEquals("x", f.name)
assertEquals(f, J::class.members.single { it.name == "x" })
f.set("OK")
assertEquals("OK", J.x)
assertEquals("OK", f.getter())
val pl = J::packageLocalField.getter
try {
pl()
return "Fail: package local field must be inaccessible"
} catch (e: Exception) {
// OK
}
return f.get()
}