Added support for continue in while/do while.
This commit is contained in:
@@ -42,4 +42,14 @@ public final class WhileTest extends AbstractExpressionTest {
|
||||
public void breakDoWhile() throws Exception {
|
||||
testFooBoxIsTrue("breakDoWhile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void continueWhile() throws Exception {
|
||||
testFooBoxIsTrue("continueWhile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void continueDoWhile() throws Exception {
|
||||
testFooBoxIsTrue("continueDoWhile.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace foo
|
||||
|
||||
fun box() : Boolean {
|
||||
var i = 0
|
||||
var b = true
|
||||
do {
|
||||
++i;
|
||||
if (i >= 1) {
|
||||
continue;
|
||||
}
|
||||
b =false;
|
||||
} while (i < 100)
|
||||
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace foo
|
||||
|
||||
fun box() : Boolean {
|
||||
var i = 0
|
||||
var b = true
|
||||
while (i < 100) {
|
||||
++i;
|
||||
if (i >= 1) {
|
||||
continue;
|
||||
}
|
||||
b =false;
|
||||
}
|
||||
|
||||
return b
|
||||
}
|
||||
Reference in New Issue
Block a user