TEST: tests for "break" and "continue" added
This commit is contained in:
committed by
KonstantinAnisimov
parent
3cee19d28e
commit
03e94c6877
@@ -0,0 +1,31 @@
|
||||
fun foo1() {
|
||||
var i = 0
|
||||
while (true) {
|
||||
if ((i++ % 2) == 0) continue
|
||||
println("while " + i.toString())
|
||||
if (i > 4) break
|
||||
}
|
||||
}
|
||||
|
||||
fun foo2() {
|
||||
var i = 0
|
||||
do {
|
||||
if ((i++ % 2) == 0) continue
|
||||
println("while " + i.toString())
|
||||
if (i > 4) break
|
||||
} while (true)
|
||||
}
|
||||
|
||||
fun foo3() {
|
||||
for (i in 1..6) {
|
||||
if ((i % 2) == 0) continue
|
||||
println("while " + i.toString())
|
||||
if (i > 4) break
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
foo1()
|
||||
foo2()
|
||||
foo3()
|
||||
}
|
||||
Reference in New Issue
Block a user