JS: move more test to box tests

This commit is contained in:
Alexey Andreev
2016-08-30 14:59:26 +03:00
parent 7e2d5b04de
commit 3801052460
112 changed files with 760 additions and 676 deletions
@@ -0,0 +1,32 @@
package foo
// CHECK_CALLED: doRun
// CHECK_NOT_CALLED: test
class X
class Y
fun <R> doRun(fn: ()->R): R = fn()
inline fun <reified A, reified B> test(x: Any, y: Any): Boolean =
doRun {
val isA = null
x is A
}
&& doRun {
val result = y is B
val isB = null
result
}
fun box(): String {
val x = X()
val y = Y()
assertEquals(true, test<X, Y>(x, y), "test<X, Y>(x, y)")
assertEquals(false, test<X, Y>(x, x), "test<X, Y>(x, x)")
assertEquals(false, test<X, Y>(y, x), "test<X, Y>(y, x)")
assertEquals(false, test<X, Y>(y, y), "test<X, Y>(y, y)")
return "OK"
}