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
+59
View File
@@ -0,0 +1,59 @@
package foo
fun testLabelledBlock() {
var c: Int = 0
js("""
block: {
c = 1;
break block;
c = 2;
}
""")
assertEquals(1, c, "testLabelledBlock")
}
fun testBreakInFor() {
var c: Int = 0
js("""
outer: for (var i = 0; i < 10; i++) {
for (var j = 0; j < 10; j++) {
if (i === 1) {
break outer;
}
c += 1;
}
}
""")
assertEquals(10, c, "testBreakInFor")
}
fun testContinueInFor() {
var c: Int = 0
js("""
outer: for (var i = 0; i < 10; i++) {
for (var j = 0; j < 10; j++) {
if (i >= 1) {
continue outer;
}
c += 1;
}
}
""")
assertEquals(10, c, "testContinueInFor")
}
fun box(): String {
testLabelledBlock()
testBreakInFor()
testContinueInFor()
return "OK"
}