The ntest lib enhances the rust test framework with some useful functions.
Compare floating point values or vectors of floating points wether they are approximately equal.
The default value for epsilon is
Expects a false expression. Otherwise panics.
A panic in Rust is not always implemented via unwinding, but can be implemented by aborting the process as well. This function only catches unwinding panics, not those that abort the process. See the catch unwind documentation for more information.
Expects a true expression. Otherwise panics.
Helper trait for
assert_about_equal macro. Returns the max difference between
two vectors of floats. Can also be used for single floats.
Test cases can be used to have multiple inputs for a given function.
#[test_case] attribute multiple tests will be generated using the
capabilities of rust.
The timeout attribute can be used for tests to let them fail if they exceed a certain execution time.
#[timeout] attribute a timeout in milliseconds is added to a test.