#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)

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

#83 in Rust patterns

Download history 7400/week @ 2024-07-27 6839/week @ 2024-08-03 6524/week @ 2024-08-10 5307/week @ 2024-08-17 4867/week @ 2024-08-24 5161/week @ 2024-08-31 4948/week @ 2024-09-07 4045/week @ 2024-09-14 4100/week @ 2024-09-21 4490/week @ 2024-09-28 4549/week @ 2024-10-05 3201/week @ 2024-10-12 3555/week @ 2024-10-19 2717/week @ 2024-10-26 4403/week @ 2024-11-02 4068/week @ 2024-11-09

15,469 downloads per month
Used in 20 crates (19 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