Expand description
Assertion macros.
This crate provides additional assert macros to make testing easier. claym does not have
depndencies and it can be used in a no-std environment.
All the macros in this crate has debug_* counterparts, like any assertion macros in the
standard libraries.
Assertions similar to assert_eq! or assert_ne!:
Assertions for Result variants:
Assertions for Option variants:
Assertions for Poll variants:
Assertions for Iterator variants:
Macrosยง
- assert_
contains - Asserts that the iterator contains a given element.
- assert_
err - Asserts that expression returns
Errvariant. - assert_
err_ eq - Asserts that expression returns
Errvariant and its value equals to the right expression. - assert_
ge - Asserts that first expression is greater or equal than the second.
- assert_
gt - Asserts that first expression is greater than the second.
- assert_
has_ length - Asserts that the iterator has the given length.
- assert_
is_ empty - Asserts that the iterator is empty.
- assert_
is_ not_ empty - Asserts that the iterator is not empty.
- assert_
le - Asserts that first expression is less or equal than the second.
- assert_
lt - Asserts that first expression is less than the second.
- assert_
matches - Asserts that expression matches any of the given variants.
- assert_
none - Asserts that expression returns
Nonevariant. - assert_
ok - Asserts that expression returns
Okvariant. - assert_
ok_ eq - Asserts that expression returns
Okvariant and its value equals to the right expression. - assert_
pending - Asserts that expression returns
Pendingvariant. - assert_
ready - Asserts that expression returns
Readyvariant. - assert_
ready_ eq - Asserts that expression returns
Readyvariant and its value equals to the right expression. - assert_
ready_ err - Asserts that expression returns
Ready(Err(..))variant. - assert_
ready_ ok - Asserts that expression returns
Ready(Ok(..))variant. - assert_
some - Asserts that expression returns
Somevariant. - assert_
some_ eq - Asserts that expression returns
Somevariant and its value equals to the right expression. - debug_
assert_ contains - Asserts that the iterator contains a given element.
- debug_
assert_ err - Asserts that expression returns
Errvariant. - debug_
assert_ err_ eq - Asserts that expression returns
Errvariant and its value equals to the right expression. - debug_
assert_ ge - Asserts that first expression is greater or equal than the second.
- debug_
assert_ gt - Asserts that first expression is greater than the second.
- debug_
assert_ has_ length - Asserts that the iterator has the given length.
- debug_
assert_ is_ empty - Asserts that the iterator is empty.
- debug_
assert_ is_ not_ empty - Asserts that the iterator is not empty.
- debug_
assert_ le - Asserts that first expression is less or equal than the second.
- debug_
assert_ lt - Asserts that first expression is less than the second.
- debug_
assert_ matches - Asserts that expression matches any of the given variants.
- debug_
assert_ none - Asserts that expression returns
Nonevariant. - debug_
assert_ ok - Asserts that expression returns
Okvariant. - debug_
assert_ ok_ eq - Asserts that expression returns
Okvariant and its value equals to the right expression. - debug_
assert_ pending - Asserts that expression returns
Pendingvariant. - debug_
assert_ ready - Asserts that expression returns
Readyvariant. - debug_
assert_ ready_ eq - Asserts that expression returns
Readyvariant and its value equals to the right expression. - debug_
assert_ ready_ err - Asserts that expression returns
Ready(Err(..))variant. - debug_
assert_ ready_ ok - Asserts that expression returns
Ready(Ok(..))variant. - debug_
assert_ some - Asserts that expression returns
Somevariant. - debug_
assert_ some_ eq - Asserts that expression returns
Somevariant and its value equals to the right expression.