Expand description
Additional assertion macros for testing.
§Available macros
Note that, like core/std macros, all macros in this crate have 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 the expression matches an
Err(_)variant, returning the contained value. - assert_
err_ eq - Asserts that the left expression contains an
Err(E)variant and its contained value of typeEequals the right expression. - assert_
ge - Asserts that the first expression is greater than or equal to the second.
- assert_
gt - Asserts that the first expression is greater than the second.
- assert_
le - Asserts that the first expression is less or equal than the second.
- assert_
lt - Asserts that the first expression is less than the second.
- assert_
matches - Asserts that the expression matches the provided pattern.
- assert_
none - Asserts that the expression is
None. - assert_
ok - Asserts that the expression matches an
Ok(_)variant, returning the contained value. - assert_
ok_ eq - Asserts that the left expression contains an
Ok(T)variant and its contained value of typeTequals the right expression. - assert_
pending - Asserts that the expression matches a
Poll::Pendingvariant. - assert_
ready - Asserts that the expression matches a
Poll::Ready(_)variant. - assert_
ready_ eq - Asserts that the left expression contains a [
Poll::Ready(T)] variant and its contained value of typeTequals the right expression. - assert_
ready_ err - Asserts that the expression matches a
Poll::Ready(Err(_))variant, returning the contained value. - assert_
ready_ ok - Asserts that the expression matches a [
Poll::Ready(Ok(_))] variant, returning the contained value. - assert_
some - Asserts that the expression matches a
Some(_)variant, returning the contained value. - assert_
some_ eq - Asserts that the left expression contains a
Some(T)variant and its contained value of typeTequals the right expression. - debug_
assert_ err - Asserts that the expression matches an
Err(_)variant in debug builds. - debug_
assert_ err_ eq - Asserts that the left expression contains an
Err(E)variant and its contained value of typeEequals the right expression in debug builds. - debug_
assert_ ge - Asserts that the first expression is greater than or equal to the second on debug builds.
- debug_
assert_ gt - Asserts that the first expression is greater than the second in debug builds.
- debug_
assert_ le - Asserts that the first expression is less or equal than the second on debug builds.
- debug_
assert_ lt - Asserts that the first expression is less than the second on debug builds.
- debug_
assert_ matches - Asserts that the expression matches the provided pattern on debug builds.
- debug_
assert_ none - Asserts that the expression is
Noneon debug builds. - debug_
assert_ ok - Asserts that the expression matches an
Ok(_)variant on debug builds. - debug_
assert_ ok_ eq - Asserts that the left expression contains an
Ok(T)variant and its contained value of typeTequals the right expression on debug builds. - debug_
assert_ pending - Asserts that the expression matches a
Poll::Pendingvariant on debug builds. - debug_
assert_ ready - Asserts that the expression matches a
Poll::Ready(_)variant on debug builds. - debug_
assert_ ready_ eq - Asserts that the left expression contains a
Poll::Ready(T)variant and its contained value of typeTequals the right expression on debug builds. - debug_
assert_ ready_ err - Asserts that the expression matches a
Poll::Ready(Err(_))variant on debug builds. - debug_
assert_ ready_ ok - Asserts that the expression matches a
Poll::Ready(Ok(_))variant on debug builds. - debug_
assert_ some - Asserts that the expression matches a
Some(_)variant on debug builds. - debug_
assert_ some_ eq - Asserts that the left expression contains a
Some(T)variant and its contained value of typeTequals the right expression on debug builds.