Struct quickcheck::TestResult
source · [−]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
sourceimpl TestResult
impl TestResult
sourcepub fn passed() -> TestResult
pub fn passed() -> TestResult
Produces a test result that indicates the current test has passed.
sourcepub fn failed() -> TestResult
pub fn failed() -> TestResult
Produces a test result that indicates the current test has failed.
sourcepub fn error<S: Into<String>>(msg: S) -> TestResult
pub fn error<S: Into<String>>(msg: S) -> TestResult
Produces a test result that indicates failure from a runtime error.
sourcepub 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).
sourcepub 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.
sourcepub fn must_fail<T, F>(f: F) -> TestResult where
F: FnOnce() -> T,
F: 'static,
T: 'static,
pub fn must_fail<T, F>(f: F) -> TestResult where
F: FnOnce() -> T,
F: 'static,
T: 'static,
Tests if a “procedure” fails when executed. The test passes only if
f
generates a task failure during its execution.
sourcepub 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
sourceimpl Clone for TestResult
impl Clone for TestResult
sourcefn clone(&self) -> TestResult
fn clone(&self) -> TestResult
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TestResult
impl Debug for TestResult
sourceimpl Testable for TestResult
impl Testable for TestResult
fn result(&self, _: &mut Gen) -> TestResult
Auto Trait Implementations
impl RefUnwindSafe for TestResult
impl Send for TestResult
impl Sync for TestResult
impl Unpin for TestResult
impl UnwindSafe for TestResult
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more