pub struct SoftAsserter { /* private fields */ }Expand description
Implementations§
Source§impl SoftAsserter
impl SoftAsserter
Sourcepub fn new() -> SoftAsserter
pub fn new() -> SoftAsserter
Creates an empty recorder. Most callers use soft rather than
constructing this directly.
Sourcepub fn check<T, M>(&mut self, actual: &T, matcher: M)
pub fn check<T, M>(&mut self, actual: &T, matcher: M)
Records whether actual satisfies matcher. A miss is collected, not
propagated, so the closure keeps running.
The recorded failure captures this call site, so each soft failure
reports the line it came from. The soft counterpart of
Subject::satisfies.
Sourcepub fn record(&mut self, result: Result<(), TestError>)
pub fn record(&mut self, result: Result<(), TestError>)
Records the result of an arbitrary fallible step. An Err is collected
with its original location and context intact; an Ok is ignored.
Sourcepub fn context(
&mut self,
message: impl Into<Cow<'static, str>>,
) -> SoftScope<'_>
pub fn context( &mut self, message: impl Into<Cow<'static, str>>, ) -> SoftScope<'_>
Opens a context sub-scope. Failures recorded through the returned
SoftScope carry message as a context frame; the frame is removed
when the SoftScope is dropped. Sub-scopes nest: a SoftScope can open
further sub-scopes, and their frames stack outermost-first.
Trait Implementations§
Source§impl Default for SoftAsserter
impl Default for SoftAsserter
Source§fn default() -> SoftAsserter
fn default() -> SoftAsserter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SoftAsserter
impl !RefUnwindSafe for SoftAsserter
impl Send for SoftAsserter
impl Sync for SoftAsserter
impl Unpin for SoftAsserter
impl UnsafeUnpin for SoftAsserter
impl !UnwindSafe for SoftAsserter
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