[][src]Enum expectest::core::TestResult

pub enum TestResult {
    Success,
    Failure(Failure),
}

Represents result of unit testing.

Variants

Success

Denotes success.

Failure(Failure)

Denotes failure.

Methods

impl TestResult[src]

pub fn new_success() -> Self[src]

Creates a new instance of TestResult with a Success variant.

pub fn new_failure(message: String, location: Option<SourceLocation>) -> Self[src]

Creates a new instance of TestResult with a Failure variant using message and location.

pub fn assert_eq_message(self, message: &str)[src]

Asserts that message is equal to the failure message.

Purpose of this method is the unit testing of failure messages. Convenient for development.

Example

expect(0 == 1).to(be_true()).assert_eq_message("expected to be true");

Panics

This method panics if the failure message is not equal to the message, or self is not the TestResult::Failure variant.

Trait Implementations

impl Debug for TestResult[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]