Skip to content

SixArm/assertables-rust-crate

Repository files navigation

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.

There are many more for results, options, polls, matches, iterators, sets, files, bytes, commands, etc.

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

assertables = "9.1.0"

Top benefits:

  1. You can write better tests to improve reliability and maintainability.
  2. You can handle more corner cases without needing to write custom code.
  3. You can troubleshoot faster because error messages show specifics.

Top features:

  1. Easy to use: everything is well-documented with runnable examples.
  2. Zero overhead: if you don't use a macro, then it's not compiled.
  3. Multiple forms: for debugging, for results, and for success returns.

Help:

Highlights

Values:

Differences:

Groups for iterators, chars, etc.:

Infix for order operators, logic operators, etc.:

Lengths and counts for strings, vectors, iterators, etc.:

Matching:

Results:

Options:

Polls:

Readers:

Commands:

Collections:

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

Forms

All the macros have forms for an optional message:

All the macros have forms for different outcomes:

Many of the macros have a "solo" form for comparing one item to an expression, and a "pair" form for comparing two items to each other:

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.1.0
  • Created: 2021-03-30T15:47:49Z
  • Updated: 2024-10-29T20:21:37Z
  • License: MIT or Apache-2.0 or GPL-2.0 or GPL-3.0 or contact us for more
  • Contact: Joel Parker Henderson ([email protected])

About

Assertables: a Rust crate of assert macros for testing

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages