Expand description
Re-export of all types, traits, functions and macros that are needed to write assertions in tests.
When writing assertions in tests importing this prelude is all that should be needed.
§Example
use asserting::prelude::*;
assert_that!(3 + 4).is_equal_to(7);
assert_that!(&[1, 3, 5, 7, 11]).contains_exactly(&[1, 3, 5, 7, 11]);
assert_that!("iusto obcaecat stet eos").starts_with("iusto").ends_with(" eos");
Re-exports§
pub use super::colored::DEFAULT_DIFF_FORMAT;
pub use super::colored::DIFF_FORMAT_NO_HIGHLIGHT;
pub use super::spec::assert_that;
pub use super::spec::verify_that;
pub use super::spec::CollectFailures;
pub use super::spec::Location;
pub use super::spec::PanicOnFail;
pub use super::colored::DIFF_FORMAT_BOLD;
colored
pub use super::colored::DIFF_FORMAT_RED_BLUE;
colored
pub use super::colored::DIFF_FORMAT_RED_GREEN;
colored
pub use super::colored::DIFF_FORMAT_RED_YELLOW;
colored
pub use super::spec::assert_that_code;
panic
pub use super::spec::verify_that_code;
panic
pub use super::assertions::*;
pub use super::properties::*;
Macros§
- assert_
that - Starts an assertion for the given subject or expression in the
PanicOnFail
mode. - assert_
that_ code panic
- Starts an assertion for some piece of code in the
PanicOnFail
mode. - verify_
that - Starts an assertion for the given subject or expression in the
CollectFailures
mode. - verify_
that_ code panic
- Starts an assertion for some piece of code in the
CollectFailures
mode.