JS: move more test to box tests
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package foo
|
||||
|
||||
var global = ""
|
||||
|
||||
fun log(message: String) {
|
||||
global += message
|
||||
}
|
||||
|
||||
fun test1(): String {
|
||||
val list = mutableListOf<(Int) -> Unit>()
|
||||
|
||||
var result = ""
|
||||
list += { log("<$it>") }
|
||||
list += { result += "($it)" }
|
||||
list += { result += "[$it]"; result += "{$it}" }
|
||||
|
||||
for(f in list) f(1)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
assertEquals("(1)[1]{1}", test1())
|
||||
assertEquals(global, "<1>")
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user