Crate claym

Source
Expand description

Assertion macros.

This crate provides additional assert macros to make testing easier. claym does not have depndencies and it can be used in a no-std environment.

All the macros in this crate has debug_* counterparts, like any assertion macros in the standard libraries.

Assertions similar to assert_eq! or assert_ne!:

Assertions for Result variants:

Assertions for Option variants:

Assertions for Poll variants:

Assertions for Iterator variants:

Macrosยง

assert_contains
Asserts that the iterator contains a given element.
assert_err
Asserts that expression returns Err variant.
assert_err_eq
Asserts that expression returns Err variant and its value equals to the right expression.
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_has_length
Asserts that the iterator has the given length.
assert_is_empty
Asserts that the iterator is empty.
assert_is_not_empty
Asserts that the iterator is not empty.
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 variant.
assert_ok_eq
Asserts that expression returns Ok variant and its value equals to the right expression.
assert_pending
Asserts that expression returns Pending variant.
assert_ready
Asserts that expression returns Ready variant.
assert_ready_eq
Asserts that expression returns Ready variant and its value equals to the right expression.
assert_ready_err
Asserts that expression returns Ready(Err(..)) variant.
assert_ready_ok
Asserts that expression returns Ready(Ok(..)) variant.
assert_some
Asserts that expression returns Some variant.
assert_some_eq
Asserts that expression returns Some variant and its value equals to the right expression.
debug_assert_contains
Asserts that the iterator contains a given element.
debug_assert_err
Asserts that expression returns Err variant.
debug_assert_err_eq
Asserts that expression returns Err variant and its value equals to the right expression.
debug_assert_ge
Asserts that first expression is greater or equal than the second.
debug_assert_gt
Asserts that first expression is greater than the second.
debug_assert_has_length
Asserts that the iterator has the given length.
debug_assert_is_empty
Asserts that the iterator is empty.
debug_assert_is_not_empty
Asserts that the iterator is not empty.
debug_assert_le
Asserts that first expression is less or equal than the second.
debug_assert_lt
Asserts that first expression is less than the second.
debug_assert_matches
Asserts that expression matches any of the given variants.
debug_assert_none
Asserts that expression returns None variant.
debug_assert_ok
Asserts that expression returns Ok variant.
debug_assert_ok_eq
Asserts that expression returns Ok variant and its value equals to the right expression.
debug_assert_pending
Asserts that expression returns Pending variant.
debug_assert_ready
Asserts that expression returns Ready variant.
debug_assert_ready_eq
Asserts that expression returns Ready variant and its value equals to the right expression.
debug_assert_ready_err
Asserts that expression returns Ready(Err(..)) variant.
debug_assert_ready_ok
Asserts that expression returns Ready(Ok(..)) variant.
debug_assert_some
Asserts that expression returns Some variant.
debug_assert_some_eq
Asserts that expression returns Some variant and its value equals to the right expression.