JS: move inline test to box tests

This commit is contained in:
Alexey Andreev
2016-08-29 11:55:22 +03:00
parent b159049be8
commit efb82a044f
150 changed files with 1417 additions and 1430 deletions
@@ -0,0 +1,39 @@
package foo
var g: Any?
get() {
log("g.get")
return null
}
set(v) {
log("g.set")
}
public inline fun Array<String>.boo() {
var a = g
for (element in this);
}
public inline fun Iterable<String>.boo(i: Any?) {
var a = i
for (element in this);
}
fun test1(f: () -> Array<String>) {
f().boo()
}
fun test2(f: () -> Iterable<String>) {
f().boo(g)
}
fun box(): String {
test1 { log("lambda1"); arrayOf() }
assertEquals("lambda1;g.get;", pullLog())
test2 { log("lambda2"); listOf() }
assertEquals("lambda2;g.get;", pullLog())
return "OK"
}