[−][src]Crate expected
An assertion utility focused on unit testing.
This library provides the variant of assertion macros that does not panic and continues test cases whenever assertions are passed or not.
Example
use expected::{expected, expect}; let name = "Alice"; let age = 14; let ((), disappoints) = expected(|| { expect!(name == "Alice"); expect!(age == 18); // ... }); if let Some(disappoints) = disappoints { eprintln!("{}", disappoints); }
Macros
expect | Declare an expectation that the specified conditional expression is true. |
expect_eq | Declare an expectation that the specified values are equal. |
Structs
Disappoint | A struct providing information about a disappointing expectation. |
Disappoints | A set of |
Expected | A future for the |
Traits
FutureExpectedExt | An extension trait for |
Functions
expected | Run the provided closure and checks to see if all expectation have been satisfied. |