Crate assertables

Source
Expand description

§Assertables: Rust crate of assert macros for testing

Assertables is a Rust crate that provides many assert macros to improve your compile-time tests and run-time reliability.

§Introduction

The Assertables Rust crate provides many assert macros that can help you develop, test, and debug.

To use this crate, add it to your file Cargo.toml:

assertables = "9.2.0"

Benefits:

  • You will write better tests to improve reliability and maintainability.
  • You will handle more corner cases without needing to write custom code.
  • You will troubleshoot faster because error messages show more detail.

Features:

  • Easy to use: everything is well-documented with runnable examples.
  • Zero overhead: if you don’t use a macro, then it’s not compiled.
  • Multiple forms: for panic, debug, result return, success return.

Learning: FAQ, examples, changes, upgrades, docs.

Comparisons: more_asserts, cool_asserts, assert2, claims, etc.

§Highlights

Values:

Differences:

Groups:

Matching:

Results:

Options:

Polls:

Readers:

Collections:

Infix notation:

For a complete list of modules and macros, see the docs.

§Forms

The Assertables macros have a variety of forms to help you write the tests that matter most to you.

All the macros have forms for an optional message:

All the macros have forms for different outcomes:

Many of the macros have a form “compare left item to right item” that compares items of the same kind, and a form “compare left item to right expression” that compares one item to any arbitrary expression:

Many of the macros has a “success return”, which means the macro returns data that you can optionally use for more testing.

§Tracking

  • Package: assertables-rust-crate
  • Version: 9.2.0
  • Created: 2021-03-30T15:47:49Z
  • Updated: 2024-10-31T11:04:30Z
  • License: MIT or Apache-2.0 or GPL-2.0 or GPL-3.0 or contact us for more
  • Contact: Joel Parker Henderson (joel@joelparkerhenderson.com)

Modules§

Macros§