[][src]Crate claim

Assertion macros.

This crate provides additional assert macros to make testing a bit easier.

Same to core/std macros, all macros in this crate has the debug_* counterparts, which are not enabled in release builds by default.

No-std

This crate is no-std by default.

Comparison

Rich comparision, similar to assert_eq:

MacroOperator
assert_ge>=
assert_gt>
assert_le<=
assert_lt<

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_none

Asserts that expression returns None variant.

assert_ok

Asserts that expression returns Ok(T) variant.

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(Ok(T)) variant and it 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.

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 or equal than the second in runtime.

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_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_eq

Asserts that left expression returns Poll::Ready(Ok(T)) variant and it value of T type equals to the right expression 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_some

Asserts that expression returns Some(T) variant in runtime.