While and for loops are working

This commit is contained in:
2022-08-20 13:27:47 +01:00
parent 975ed41d14
commit f5e060051e
4 changed files with 116 additions and 12 deletions

View File

@@ -18,4 +18,23 @@ else {
}
print "All good";
//test while loop
var whileCounter = 0;
while (whileCounter < 10) {
whileCounter = whileCounter + 1;
}
assert whileCounter == 10, "while-loop failed";
//test for loop
var forCache = 0;
for (var i = 0; i < 20; i = i + 1) {
forCache = i;
}
assert forCache == 19, "for-loop failed";
print "All good";