JS: move more test to box tests

This commit is contained in:
Alexey Andreev
2016-08-29 12:37:13 +03:00
parent efb82a044f
commit cdf2212c73
70 changed files with 484 additions and 749 deletions
+35
View File
@@ -0,0 +1,35 @@
package foo
// CHECK_LABELS_COUNT: function=testBreak name=loop count=1
// CHECK_LABELS_COUNT: function=testContinue name=loop count=1
fun testBreak() {
var i = 0
loop@ for (j in 1..10) {
if (j == 5) break@loop
i = j
}
assertEquals(4, i, "break")
}
fun testContinue() {
var sum = 0
loop@ for (j in 1..5) {
if (j % 2 != 0) continue@loop
sum += j
}
assertEquals(6, sum, "continue")
}
fun box(): String {
testBreak()
testContinue()
return "OK"
}