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;coloredpub use super::colored::DIFF_FORMAT_RED_BLUE;coloredpub use super::colored::DIFF_FORMAT_RED_GREEN;coloredpub use super::colored::DIFF_FORMAT_RED_YELLOW;coloredpub use super::spec::assert_that_code;panicpub use super::spec::verify_that_code;panicpub use super::assertions::*;pub use super::properties::*;
Macros§
- assert_
that - Starts an assertion for the given subject or expression in the
PanicOnFailmode. - assert_
that_ code panic - Starts an assertion for some piece of code in the
PanicOnFailmode. - verify_
that - Starts an assertion for the given subject or expression in the
CollectFailuresmode. - verify_
that_ code panic - Starts an assertion for some piece of code in the
CollectFailuresmode.