Move some tests from boxWithStdlib/ to box/

Move those tests which do not require neither stdlib nor reflect
This commit is contained in:
Alexander Udalov
2016-03-05 18:39:20 +03:00
committed by Alexander Udalov
parent 54a615fcd3
commit 20e36438e2
217 changed files with 1561 additions and 1397 deletions
@@ -0,0 +1,27 @@
fun foo(): String = "foo1"
fun foo(i: Int): String = "foo2"
val f1: () -> String = ::foo
val f2: (Int) -> String = ::foo
fun foo1() {}
fun foo2(i: Int) {}
fun bar(f: () -> Unit): String = "bar1"
fun bar(f: (Int) -> Unit): String = "bar2"
fun box(): String {
val x1 = f1()
if (x1 != "foo1") return "Fail 1: $x1"
val x2 = f2(0)
if (x2 != "foo2") return "Fail 2: $x2"
val y1 = bar(::foo1)
if (y1 != "bar1") return "Fail 3: $y1"
val y2 = bar(::foo2)
if (y2 != "bar2") return "Fail 4: $y2"
return "OK"
}
@@ -1,5 +1,4 @@
import kotlin.reflect.*
import kotlin.test.assertEquals
class A {
val x = 1
@@ -12,8 +11,8 @@ val f2: (A) -> String = A::x
fun box(): String {
val a = A()
assertEquals(1, f1.get(a))
assertEquals("OK", f2(a))
val x1 = f1.get(a)
if (x1 != 1) return "Fail 1: $x1"
return "OK"
}
return f2(a)
}

Some files were not shown because too many files have changed in this diff Show More