tests: Update external tests (1.1.2-dev-393)

This commit is contained in:
Ilya Matveev
2017-03-13 12:38:08 +03:00
committed by ilmat192
parent ac56fccb15
commit bc074e6d39
3178 changed files with 22396 additions and 696 deletions
@@ -0,0 +1,33 @@
// IGNORE_BACKEND: NATIVE
// FILE: 1.kt
// WITH_RUNTIME
package test
inline fun foo1() = run {
{
"OK"
}
}
var sideEffects = "fail"
inline fun foo2() = run {
{
Runnable {
sideEffects = "OK"
}
}
}
// FILE: 2.kt
import test.*
fun box(): String {
val x1 = foo1()()
if (x1 != "OK") return "fail 1: $x1"
foo2()().run()
return sideEffects
}
@@ -0,0 +1,34 @@
// IGNORE_BACKEND: NATIVE
// NO_CHECK_LAMBDA_INLINING
// WITH_RUNTIME
// FILE: 1.kt
package test
inline fun test(s: () -> Unit) {
s()
}
// FILE: 2.kt
import test.*
fun box(): String {
var encl1 = "fail";
var encl2 = "fail";
test {
{
val p = object {}
encl1 = p.javaClass.enclosingMethod.declaringClass.name
{
val p = object {}
encl2 = p.javaClass.enclosingMethod.declaringClass.name
}()
}()
}
if (encl1 != "_2Kt\$box\$\$inlined\$test\$lambda$1") return "fail 1: $encl1"
if (encl2 != "_2Kt\$box\$\$inlined\$test\$lambda$1$2") return "fail 2: $encl2"
return "OK"
}