Aer/tests/assertion_test.aer
belliash 6b86f4c855
All checks were successful
The build was successful.
Add assertion test.
2019-04-10 09:23:23 +02:00

20 lines
426 B
Plaintext

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