Crate claim

Source
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 of T 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 of T 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 of T 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 of T 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.