#testing-debugging #assertions #assert #macro #test #assertable

assertables

Assertables: assert macros for better testing, debugging, quality assurance, and runtime reliability

49 stable releases (6 major)

new 9.3.0 Nov 3, 2024
8.18.0 Oct 9, 2024
7.0.1 Mar 8, 2023
6.0.1 Jan 10, 2023
3.2.2 May 13, 2021

#82 in Rust patterns

Download history 6129/week @ 2024-07-19 6799/week @ 2024-07-26 7554/week @ 2024-08-02 6676/week @ 2024-08-09 5292/week @ 2024-08-16 4783/week @ 2024-08-23 5268/week @ 2024-08-30 5064/week @ 2024-09-06 3920/week @ 2024-09-13 4239/week @ 2024-09-20 4527/week @ 2024-09-27 4724/week @ 2024-10-04 2906/week @ 2024-10-11 3826/week @ 2024-10-18 2816/week @ 2024-10-25 2763/week @ 2024-11-01

12,961 downloads per month
Used in 19 crates (18 directly)

MIT OR Apache-2…

2.5MB
31K SLoC

Contains (WOFF font, 400KB) NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2, (WOFF font, 135KB) FiraSans-Medium-8f9a781e4970d388.woff2, (WOFF font, 130KB) FiraSans-Regular-018c141bf0843ffd.woff2, (WOFF font, 82KB) SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2, (WOFF font, 77KB) SourceSerif4-Regular-46f98efaafac5295.ttf.woff2, (WOFF font, 45KB) SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 and 3 more.

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.3.0"

Benefits:

  • You can write better tests to improve reliability and maintainability.
  • You can handle more corner cases without needing to write custom code.
  • You can 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:

Approximations:

Groups:

Matching:

Results:

Options:

Polls:

Readers:

Collections:

Infix notation:

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 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.3.0
  • Created: 2021-03-30T15:47:49Z
  • Updated: 2024-11-03T21:01:28Z
  • 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)

No runtime deps