# Comparisons: claims and related crates There are various Rust crates that provide assert macros: * [`claims`](https://crates.io/crates/claims) * [`claim`](https://crates.io/crates/claim) which was forked to create `claims`. Each of these crates are doing the same surface-level thing as Assertables, by adding new assert macros. Assertables has two major differences: * More assertions * More logic leverage ## Assertables has more assertions If there's an assertion from any of those crates that you would like us to add to Assertables, then let us know, or create a merge request, and we'll add it.
Category Assertables claims
Version 8.4 0.7
Updated 2024 2022
Compare assert_lt
assert_le
assert_gt
assert_ge
assert_lt
assert_le
assert_gt
assert_ge
Nearness assert_in_delta
assert_in_epsilon
Match assert_is_match
assert_not_match
assert_matches
 
Contains assert_contains
assert_not_contains
Starts With assert_starts_with
assert_not_starts_with
Ends With assert_ends_with
assert_not_ends_with
Result assert_ok
assert_ok_eq
assert_ok_ne
assert_err
assert_ok
assert_ok_eq
-
assert_err
Option assert_some
assert_some_eq (eta v8.5)
assert_some_ne (eta v8.5)
assert_none
assert_some
assert_some_eq
-
assert_none
Poll assert_ready
assert_ready_eq
assert_ready_ne
assert_ready_ok(eta 8.7)
assert_ready_err(eta 8.7)
assert_pending
assert_ready
assert_ready_eq
-
assert_ready_ok
assert_ready_err
assert_pending
Readers assert_fs_read_to_string_*
assert_io_read_to_string_*
Commands assert_command_*
assert_program_args_*
Collections assert_set_*
assert_bag_*
Functions assert_fn_*
assert_fn_ok_*
assert_fn_err_*
## Assertables has more logic leverage Assertables makes deliberate design decisions to implement each concept as three macros: * The logic macro. This returns a Result and is the most important of the three macros. * The panic macro. This is what a typical cargo test uses. * The debug macro. This is what a typical runtime debug config uses. Assertables puts all the logic in the logic macro, and developers can use the same logic anywhere they want, even for totally different purposes: * Runtime production analysis using a Result. This works without triggering a panic, and without needing any debug config. * Chaos engineering where logic macros can detect dirty input, or missing files, or bad data. This well for UI interactions with users, with fallback files, and with data sanitization. * Custom macro wrapping where developers prefer to write their own syntax for their tests. This works well because the new syntax is just a surface-level addition, and can delegate to the logic macro. ## Compare a macro with various implementations You can see the difference for yourself, such as in these two source code files: * [`assert_gt`](https://github.com/SixArm/assertables-rust-crate/blob/main/src/assert_gt.rs) by Assertables. * [`assert_gt`](https://crates.io/crates/rust-claim) by rust-claim. You can see `assertables` provides three macros: * The logic macro is `assert_gt_as_result`. It does the comparison and returns a Result and possible error message. * The panic macro is `assert_gt`. It is a thin wrapper. * The debug macro is `debug_assert_gt`. It is a thin wrapper. You can see `claim` provides two macros: * The panic macro is `assert_gt`. It contains the logic, which means the logic can't be reused independently. * The debug macro is `debug_assert_gt`. It is a thin wrapper.