Browse Source

Add more tests.

pull/50/head
Rafal Kupiec 3 years ago
parent
commit
ed8dab7870
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
  1. 15
      tests/callback_function.aer
  2. 4
      tests/callback_function.exp
  3. 13
      tests/reference_test.aer
  4. 1
      tests/reference_test.exp

15
tests/callback_function.aer

@ -0,0 +1,15 @@
class Program {
function main(string[] $args) {
callback $y = function() {
callback $a = 'printf';
$a("I'm alive\n");
var_dump($a);
};
$y();
var_dump($y);
string $a = 'printf';
var_dump($a);
}
}

4
tests/callback_function.exp

@ -0,0 +1,4 @@
I'm alive
callback(6 'printf')
callback(11 '{closure_1}')
string(6 'printf')

13
tests/reference_test.aer

@ -0,0 +1,13 @@
class Program {
function add_by_ref(int &$val) {
$val += 7;
}
function main() {
int $num = 7;
$this->add_by_ref($num);
var_dump($num);
}
}

1
tests/reference_test.exp

@ -0,0 +1 @@
int(14)
Loading…
Cancel
Save