1 unstable release
0.1.0 | Jan 4, 2023 |
---|
#10 in #passes
4KB
52 lines
should-be
Postfix assertions of equality
use should_be::ShouldBe; // Import the trait
let yaks_shaved = 0;
yaks_shaved.should_be(0); // passes
yaks_shaved.should_be(1); // panics
// you can provide a panic message using a tuple.
yaks_shaved.should_be((1, "why haven't you shaved?"))
lib.rs
:
Postfix assertions of equality
use should_be::ShouldBe; // Import the trait
let yaks_shaved = 0;
yaks_shaved.should_be(0); // passes
yaks_shaved.should_be(1); // panics
// you can provide a panic message using a tuple.
yaks_shaved.should_be((1, "why haven't you shaved?"))