Struct quickcheck::TestResult [] [src]

pub struct TestResult {
    // some fields omitted
}

Describes the status of a single instance of a test.

All testable things must be capable of producing a TestResult.

Methods

impl TestResult

fn passed() -> TestResult

Produces a test result that indicates the current test has passed.

fn failed() -> TestResult

Produces a test result that indicates the current test has failed.

fn error<S: Into<String>>(msg: S) -> TestResult

Produces a test result that indicates failure from a runtime error.

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).

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.

fn must_fail<T, F>(f: F) -> TestResult where F: FnOnce() -> T, F: Send + 'static, T: Send + 'static

Tests if a "procedure" fails when executed. The test passes only if f generates a task failure during its execution.

fn is_failure(&self) -> bool

Returns true if and only if this test result describes a failing test.

fn is_error(&self) -> bool

Returns true if and only if this test result describes a failing test as a result of a run time error.

Trait Implementations

impl Testable for TestResult

fn result<G: Gen>(&self, _: &mut G) -> TestResult

Derived Implementations

impl Debug for TestResult

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for TestResult

fn clone(&self) -> TestResult

fn clone_from(&mut self, source: &Self)