Browse Source

Extend this test.

release/v0.1
Rafal Kupiec 1 year ago
parent
commit
76880ae4e2
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
2 changed files with 36 additions and 1 deletions
  1. +29
    -0
      tests/entry_point.aer
  2. +7
    -1
      tests/entry_point.exp

+ 29
- 0
tests/entry_point.aer View File

@ -1,7 +1,35 @@
class Test1 {
void __construct() {
print("Test1::__construct() called.\n");
}
void __destruct() {
print("Test1::__destruct() called.\n");
}
}
class Test2 extends Test1 {
void __construct() {
print("Test2::__construct() called.\n");
$parent->__construct();
}
void __destruct() {
print("Test2::__destruct() called.\n");
$parent->__destruct();
}
}
class Program {
object $test;
void __construct() {
print("Program::__construct() called.\n");
$this->test = new Test1();
}
void __destruct() {
@ -10,6 +38,7 @@ class Program {
void main() {
print("Program::main() called.\n");
object $test = new Test2();
}
}

+ 7
- 1
tests/entry_point.exp View File

@ -1,3 +1,9 @@
Program::__construct() called.
Test1::__construct() called.
Program::main() called.
Program::__destruct() called.
Test2::__construct() called.
Test1::__construct() called.
Program::__destruct() called.
Test1::__destruct() called.
Test2::__destruct() called.
Test1::__destruct() called.

Loading…
Cancel
Save