Browse Source

Test do { ... } while(); loop.

pull/50/head
Rafal Kupiec 1 year ago
parent
commit
b668d0a897
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
2 changed files with 29 additions and 0 deletions
  1. +23
    -0
      tests/loop_do_while_test.aer
  2. +6
    -0
      tests/loop_do_while_test.exp

+ 23
- 0
tests/loop_do_while_test.aer View File

@ -0,0 +1,23 @@
class Program {
private int test() {
static int $x = 9;
return $x--;
}
public void main() {
int $a;
do {
$a = $this->test();
int $z = $a;
if($z == 6) {
continue;
} else if($z == 3) {
break;
}
print("$z\n");
} while($a);
print("$a\n");
}
}

+ 6
- 0
tests/loop_do_while_test.exp View File

@ -0,0 +1,6 @@
9
8
7
5
4
3

Loading…
Cancel
Save