Assertables: Rust crate of "assert" macros for testing

The assertables Rust crate provides many "assert" macros to help with compile-time testing and run-time reliability

Crate: https://crates.io/crates/assertables

Docs: https://docs.rs/assertables/

Repo: https://github.com/sixarm/assertables-rust-crate/

Highlights

Value macros:

Set macros:

Function macros:

Reader macros:

Commmand macros:

Naming conventions

Abbreviations:

Shorthands:

Forms for panic! or Result Err()

The macros have forms for immediate interrupts or returning results:

Forms for default messages or custom messages

The macros have forms for default messages or custom messages.

Example:

Forms for comparing an expression versus equivalent

Some macros have forms for comparing to an expression (expr) versus an equivalent (other):

Example:

assert_* for values

Compare values.

assertset* for set collection comparisons

These macros help with comparison of set parameters, such as two arrays or two vectors. where the item order does not matter, and the item count does not matter. The macros convert inputs into HashSet iterators.

assertbag* for bag collection comparisons

These macros help with comparison of bag parameters, such as comparison of two arrays or two vectors, where the item order does not matter, and the item count does matter. The macros convert inputs into HashMap iterators.

assertfn* for function return comparisons

assertfnok_* for function Ok() comparisons

assertfnerr_* for function Err() comparisons

assertreadtostring* for std::io::Read comparisons

These macros help with readers, such as file handles, byte arrays, input streams, and the trait std::io::Read.

assertcommand for process command comparisons

Using standard output a.k.a. stdout:

Using standard error a.k.a. stderr:

Tracking