9 unstable releases (3 breaking)

0.4.1 Aug 4, 2024
0.3.4 Aug 3, 2024
0.2.2 May 23, 2024
0.2.0 Mar 28, 2024
0.1.5 Nov 30, 2023

#116 in Testing

Download history 4481/week @ 2024-07-15 4991/week @ 2024-07-22 7511/week @ 2024-07-29 4457/week @ 2024-08-05 5071/week @ 2024-08-12 6207/week @ 2024-08-19 8272/week @ 2024-08-26 10004/week @ 2024-09-02 8475/week @ 2024-09-09 7144/week @ 2024-09-16 6791/week @ 2024-09-23 6793/week @ 2024-09-30 7371/week @ 2024-10-07 7176/week @ 2024-10-14 8100/week @ 2024-10-21 8703/week @ 2024-10-28

31,782 downloads per month
Used in 58 crates (8 directly)

MIT license

55KB
1.5K SLoC

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