15 unstable releases (3 breaking)

0.4.1 Aug 4, 2024
0.4.0 Aug 4, 2024
0.3.4 Aug 3, 2024
0.2.1 May 4, 2024
0.1.5 Nov 30, 2023

#1014 in Procedural macros

Download history 5361/week @ 2024-08-02 4830/week @ 2024-08-09 6114/week @ 2024-08-16 7064/week @ 2024-08-23 9866/week @ 2024-08-30 10059/week @ 2024-09-06 6325/week @ 2024-09-13 7553/week @ 2024-09-20 6797/week @ 2024-09-27 6819/week @ 2024-10-04 7708/week @ 2024-10-11 7319/week @ 2024-10-18 9199/week @ 2024-10-25 10945/week @ 2024-11-01 11817/week @ 2024-11-08 13075/week @ 2024-11-15

46,514 downloads per month
Used in 75 crates (via equator)

MIT license

32KB
803 lines

equator

equator is an assertion library that aims to provide helpful diagnostics when multiple conditions need to be asserted at once, without short-circuiting.

Valid assertions must be of the form:

  • cond for testing a single condition,
  • all(...) for testing that multiple conditions all hold simultaneously,
  • any(...) for testing that at least one condition holds.

all and any may be arbitrarily nested.

Example

let x = 0;
let y = 1;

let a = 4;
let b = 2;

// `equator::debug_assert!` is also available for debug-only assertions
equator::assert!(all(x == y, a < b));

This should panic with an error message like

Assertion failed at path/main.rs:8:1
Assertion failed: x == y
- x = 0
- y = 1
Assertion failed: a < b
- a = 4
- b = 2

Dependencies

~255–710KB
~17K SLoC