Expand description
Assertion macros.
This crate provides additional assert macros to make testing a bit easier.
§#![no_std]
support
claim
can be used in a no-std
environments too.
§Available macros
Note that same to core
/std
macros,
all macros in this crate has the debug_*
counterparts.
§Comparison
Assertions similar to assert_eq
or assert_ne
:
§Matching
§Result
macros
Assertions for Result
variants:
§Option
macros
Assertions for Option
variants:
§Poll
macros
Assertions for Poll
variants:
Macros§
- assert_
err - Asserts that expression returns
Err(E)
variant. - 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_
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(T)
variant. - assert_
ok_ eq - Asserts that expression returns
Ok(T)
variant and its value ofT
type equals to the right expression. - assert_
pending - Asserts that expression returns
Poll::Pending
variant. - assert_
ready - Asserts that expression returns
Poll::Ready(T)
variant. - assert_
ready_ eq - Asserts that left expression returns [
Poll::Ready(T)
] variant and its value ofT
type equals to the right expression. - assert_
ready_ err - Asserts that expression returns
Poll::Ready(Err(E))
variant. - assert_
ready_ ok - Asserts that expression returns
Poll::Ready(Ok(T))
variant. - assert_
some - Asserts that expression returns
Some(T)
variant. - assert_
some_ eq - Asserts that left expression returns
Some(T)
variant and its value ofT
type equals to the right expression. - debug_
assert_ err - Asserts that expression returns
Err(E)
variant in runtime. - debug_
assert_ ge - Asserts that first expression is greater or equal than the second in runtime.
- debug_
assert_ gt - Asserts that first expression is greater than the second in runtime.
- debug_
assert_ le - Asserts that first expression is less or equal than the second in runtime.
- debug_
assert_ lt - Asserts that first expression is less than the second in runtime.
- debug_
assert_ matches - Asserts that expression matches any of the given variants.
- debug_
assert_ none - Asserts that expression returns
None
variant in runtime. - debug_
assert_ ok - Asserts that expression returns
Ok(T)
variant in runtime. - debug_
assert_ ok_ eq - Asserts that expression returns
Ok(T)
variant in runtime. - debug_
assert_ pending - Asserts that expression returns
Poll::Pending
variant in runtime. - debug_
assert_ ready - Asserts that expression returns
Poll::Ready(T)
variant in runtime. - debug_
assert_ ready_ err - Asserts that expression returns
Poll::Ready(Err(E))
variant in runtime. - debug_
assert_ ready_ ok - Asserts that expression returns
Poll::Ready(Ok(T))
variant in runtime. - debug_
assert_ ready_ ok_ eq - Asserts that left expression returns [
Poll::Ready(T)
] variant and its value ofT
type equals to the right expression in runtime. - debug_
assert_ some - Asserts that expression returns
Some(T)
variant in runtime. - debug_
assert_ some_ eq - Asserts that expression returns
Some(T)
variant in runtime.