Expand description
This crate offers a list of macros for unittest support. The aim of these macros is to extends existing rust unittest macros
by adding some new assertions and facilities.
Macrosยง
- assert_
all - Multi-assertion macro. This macro take at least 1 argument as an expression. Several expressions can be added.
- assert_
match_ option - Assert the
Option<T>value. If the value isSome(...)returnOk(()), otherwise aErrvalue. - assert_
match_ result - Assert for a
Result<T, E>value. If the value is a type ofOk(_)the result isOk(()). If the value is a type ofErr(_)the result is a type ofErr(&str). - assert_
match_ values - Assertion for matching specific values.
- assert_
not_ match_ option - Assert the
Option<T>for a result that does not match the given argument. If the value isNonereturnOk(())result. If the value isSome(...)returnNoneresult. - assert_
not_ match_ result - Assert for a not valid
Result<T, E>value. If the value is a type ofErr(_)the result isOk(()). If the value is a type ofOk(_)the result is a type ofErr(&str). - assert_
not_ match_ values - Assert on invalid values.
- assert_
not_ same_ slices - Assertion for not same slices. Not same slices means, is not same content or not same the size.
- assert_
same_ slices - Assertion for same slices. Same slices means, the order is not guaranteed, but the size and the content are equals.
- assert_
slices_ eq - Assertion about slices equality.
- assert_
slices_ ne - Assertion about slices inequality.
- facility_
match_ values - Match the specific values.
- fail
- Force the test failure.
- repeat
- Repeat the code block for a number of iterations.
- setup
- Setup for unit test initialization.
- teardown
- Teardown for unit tests. The code of the teardown macro will be running automatically while the test will end, with test failure or not.