pub enum TestResult {
Success,
Failure(Failure),
}
Expand description
Represents result of unit testing.
Variants§
Implementations§
Source§impl TestResult
impl TestResult
Sourcepub fn new_success() -> Self
pub fn new_success() -> Self
Creates a new instance of TestResult
with a Success
variant.
Sourcepub fn new_failure(message: String, location: Option<SourceLocation>) -> Self
pub fn new_failure(message: String, location: Option<SourceLocation>) -> Self
Creates a new instance of TestResult
with a Failure
variant using message
and location.
Sourcepub fn assert_eq_message(self, message: &str)
pub fn assert_eq_message(self, message: &str)
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§
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
Mutably borrows from an owned value. Read more