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
Err
variant. - assert_
err_ eq - Asserts that expression returns
Err
variant 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
None
variant. - assert_
ok - Asserts that expression returns
Ok
variant. - assert_
ok_ eq - Asserts that expression returns
Ok
variant and its value equals to the right expression. - assert_
pending - Asserts that expression returns
Pending
variant. - assert_
ready - Asserts that expression returns
Ready
variant. - assert_
ready_ eq - Asserts that expression returns
Ready
variant 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
Some
variant. - assert_
some_ eq - Asserts that expression returns
Some
variant 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
Err
variant. - debug_
assert_ err_ eq - Asserts that expression returns
Err
variant 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
None
variant. - debug_
assert_ ok - Asserts that expression returns
Ok
variant. - debug_
assert_ ok_ eq - Asserts that expression returns
Ok
variant and its value equals to the right expression. - debug_
assert_ pending - Asserts that expression returns
Pending
variant. - debug_
assert_ ready - Asserts that expression returns
Ready
variant. - debug_
assert_ ready_ eq - Asserts that expression returns
Ready
variant 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
Some
variant. - debug_
assert_ some_ eq - Asserts that expression returns
Some
variant and its value equals to the right expression.