diff --git a/tests/entry_point.aer b/tests/entry_point.aer index e167638..029de8e 100644 --- a/tests/entry_point.aer +++ b/tests/entry_point.aer @@ -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(); } } diff --git a/tests/entry_point.exp b/tests/entry_point.exp index 241f33f..ae44937 100644 --- a/tests/entry_point.exp +++ b/tests/entry_point.exp @@ -1,3 +1,9 @@ Program::__construct() called. +Test1::__construct() called. Program::main() called. -Program::__destruct() called. \ No newline at end of file +Test2::__construct() called. +Test1::__construct() called. +Program::__destruct() called. +Test1::__destruct() called. +Test2::__destruct() called. +Test1::__destruct() called.