tests: Update box tests (1050294:id)

This commit is contained in:
Ilya Matveev
2017-04-24 17:17:41 +07:00
committed by ilmat192
parent 569ceff5f9
commit 8df15dca5a
96 changed files with 1165 additions and 145 deletions
@@ -0,0 +1,22 @@
fun test1(): Boolean {
test1@ for(i in 1..2) {
continue@test1
return false
}
return true
}
fun test2(): Boolean {
test2@ while (true) {
break@test2
}
return true
}
fun box(): String {
if (!test1()) return "fail test1"
if (!test2()) return "fail test2"
return "OK"
}
@@ -0,0 +1,24 @@
fun test(x: Int): Int {
x myMap {
return@myMap
}
return 0
}
fun myMap(x: Int): Int {
x myMap {
return@myMap
}
return 0
}
infix fun Int.myMap(x: () -> Unit) {}
fun box(): String {
test(0)
myMap(0)
return "OK"
}