Crate claims

Source
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 type E equals 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 type T equals the right expression.
assert_pending
Asserts that the expression matches a Poll::Pending variant.
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 type T equals 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 type T equals 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 type E equals 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 None on 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 type T equals the right expression on debug builds.
debug_assert_pending
Asserts that the expression matches a Poll::Pending variant 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 type T equals 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 type T equals the right expression on debug builds.