Aer/tests/assertion_test.aer

20 lines
446 B
Plaintext
Raw Normal View History

2019-04-10 09:23:23 +02:00
class Program {
void test_assert(mixed $param) {
assert("is_bool($param);");
}
public void main() {
2019-04-10 09:52:20 +02:00
callback $assert_fail = void(string $file, int $line, string $code) {
2019-04-10 09:23:23 +02:00
print("Assertion failed ...\n");
};
2019-04-10 09:52:20 +02:00
assert_options(ASSERT_ACTIVE, true);
assert_options(ASSERT_BAIL, false);
assert_options(ASSERT_WARNING, false);
assert_options(ASSERT_CALLBACK, $assert_fail);
2019-04-10 09:23:23 +02:00
$this->test_assert(true);
$this->test_assert(1);
}
}