From 6b86f4c8552c1856480213856b2b8332f6653101 Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 10 Apr 2019 09:23:23 +0200 Subject: [PATCH] Add assertion test. --- tests/assertion_test.aer | 19 +++++++++++++++++++ tests/assertion_test.exp | 1 + 2 files changed, 20 insertions(+) create mode 100644 tests/assertion_test.aer create mode 100644 tests/assertion_test.exp diff --git a/tests/assertion_test.aer b/tests/assertion_test.aer new file mode 100644 index 0000000..48813e6 --- /dev/null +++ b/tests/assertion_test.aer @@ -0,0 +1,19 @@ +class Program { + + void test_assert(mixed $param) { + assert("is_bool($param);"); + } + + void main() { + callback $a = void(string $file, int $line, string $code) { + print("Assertion failed ...\n"); + }; + assert_options(ASSERT_ACTIVE, true); + assert_options(ASSERT_BAIL, false); + assert_options(ASSERT_WARNING, false); + assert_options(ASSERT_CALLBACK, $a); + $this->test_assert(true); + $this->test_assert(1); + } + +} diff --git a/tests/assertion_test.exp b/tests/assertion_test.exp new file mode 100644 index 0000000..8babf68 --- /dev/null +++ b/tests/assertion_test.exp @@ -0,0 +1 @@ +Assertion failed ...