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§
source§impl 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) -> 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.
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§
source§impl Clone for TestResult
impl Clone for TestResult
source§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 moresource§impl Debug for TestResult
impl Debug for TestResult
source§impl Testable for TestResult
impl Testable for TestResult
fn result(&self, _: &mut Gen) -> TestResult
Auto Trait Implementations§
impl Freeze for TestResult
impl RefUnwindSafe for TestResult
impl Send for TestResult
impl Sync for TestResult
impl Unpin for TestResult
impl UnwindSafe for TestResult
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)