should
should is a postfix assertion library for Rust, heavily inspired by Shouldly. It aims to make writing assertions feel more natural, while also providing clear error messages.
It does this by implementing assertion traits generically, while also utilizing stack traces to reconstruct the original expression:
panicked at 'multiply(3, 5) should be 15 but was 8'
Assertions
Implemented for T: PartialEq as well as Ok(T) and Some(T)
should_beshould_not_be
Implemented for T: PartialOrd as well as Ok(T) and Some(T)
should_be_ltshould_be_leshould_be_gtshould_be_ge
Implemented for Option<T>
should_be_someshould_be_none
Implemented for Result<T, E>
should_be_okshould_be_err
All asserted types are required to have implemented Debug.