Module tanya.test.assertion

Additional assertions.

This module provides functions that assert whether a given expression satisfies some complex condition, that can't be tested with assert in a single line. Internally all the functions just evaluate the expression and call assert.

The functions can cause segmentation fault if the module is compiled in production mode and the condition fails.

Functions

NameDescription
assertNotThrown(expr, args) Asserts that the function expr doesn't throw.
assertThrown(expr, args) Asserts whether the function expr throws an exception of type E. If it does, the exception is catched and properly destroyed. If it doesn't, an assertion error is thrown. If the exception doesn't match E type, it isn't catched and escapes.