Browse Source

Add more tests.

pull/50/head
Rafal Kupiec 2 years ago
parent
commit
ed8dab7870
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
4 changed files with 33 additions and 0 deletions
  1. +15
    -0
      tests/callback_function.aer
  2. +4
    -0
      tests/callback_function.exp
  3. +13
    -0
      tests/reference_test.aer
  4. +1
    -0
      tests/reference_test.exp

+ 15
- 0
tests/callback_function.aer View File

@ -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
- 0
tests/callback_function.exp View File

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

+ 13
- 0
tests/reference_test.aer View File

@ -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
- 0
tests/reference_test.exp View File

@ -0,0 +1 @@
int(14)

Loading…
Cancel
Save