added tests for break and continue

This commit is contained in:
Moritz Gmeiner 2024-08-27 18:59:34 +02:00
commit 54dc78f0b8
7 changed files with 123 additions and 2 deletions

21
lox.t/continue/while.lox Normal file
View file

@ -0,0 +1,21 @@
var i = 0;
while (i < 10) {
if (i == 5) {
i = i + 1;
continue;
}
print i;
i = i + 1;
}
// expect: 0
// expect: 1
// expect: 2
// expect: 3
// expect: 4
// expect: 6
// expect: 7
// expect: 8
// expect: 9