Browse Source

Add assertion test.

pull/50/head
Rafal Kupiec 1 year ago
parent
commit
6b86f4c855
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
2 changed files with 20 additions and 0 deletions
  1. +19
    -0
      tests/assertion_test.aer
  2. +1
    -0
      tests/assertion_test.exp

+ 19
- 0
tests/assertion_test.aer View File

@ -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);
}
}

+ 1
- 0
tests/assertion_test.exp View File

@ -0,0 +1 @@
Assertion failed ...

Loading…
Cancel
Save