Struct TestResult
pub struct TestResult { /* private fields */ }Expand description
Describes the status of a single instance of a test.
All testable things must be capable of producing a TestResult.
Implementations§
§impl TestResult
impl TestResult
pub fn passed() -> TestResult
pub fn passed() -> TestResult
Produces a test result that indicates the current test has passed.
pub fn failed() -> TestResult
pub fn failed() -> TestResult
Produces a test result that indicates the current test has failed.
pub fn error<S>(msg: S) -> TestResult
pub fn error<S>(msg: S) -> TestResult
Produces a test result that indicates failure from a runtime error.
pub fn discard() -> TestResult
pub fn discard() -> TestResult
Produces a test result that instructs quickcheck to ignore it.
This is useful for restricting the domain of your properties.
When a test is discarded, quickcheck will replace it with a
fresh one (up to a certain limit).
pub fn from_bool(b: bool) -> TestResult
pub fn from_bool(b: bool) -> TestResult
Converts a bool to a TestResult. A true value indicates that
the test has passed and a false value indicates that the test
has failed.
pub fn must_fail<T, F>(f: F) -> TestResultwhere
F: FnOnce() -> T + 'static,
T: 'static,
pub fn must_fail<T, F>(f: F) -> TestResultwhere
F: FnOnce() -> T + 'static,
T: 'static,
Tests if a “procedure” fails when executed. The test passes only if
f generates a task failure during its execution.
pub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Returns true if and only if this test result describes a failing
test.
Trait Implementations§
§impl Clone for TestResult
impl Clone for TestResult
§fn clone(&self) -> TestResult
fn clone(&self) -> TestResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more