Browse Source

Test while loop.

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

+ 23
- 0
tests/loop_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;
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");
}
}

+ 6
- 0
tests/loop_while_test.exp View File

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

Loading…
Cancel
Save