diff --git a/tests/loop_while_test.aer b/tests/loop_while_test.aer new file mode 100644 index 0000000..031a913 --- /dev/null +++ b/tests/loop_while_test.aer @@ -0,0 +1,23 @@ +class Program { + + private int test() { + static int $x = 9; + return $x--; + } + + public void main() { + int $a; + int $b = 2; + while($a = $this->test()) { + int $b = $a; + if($b == 6) { + continue; + } else if($b == 3) { + break; + } + print("$b\n"); + } + print("$b\n"); + } + +} diff --git a/tests/loop_while_test.exp b/tests/loop_while_test.exp new file mode 100644 index 0000000..222651f --- /dev/null +++ b/tests/loop_while_test.exp @@ -0,0 +1,6 @@ +9 +8 +7 +5 +4 +2