Skip to main content

TestingT

Trait TestingT 

Source
pub trait TestingT {
    // Required methods
    fn errorf(&self, msg: &str);
    fn fail_now(&self);
}
Expand description

Hooks for reporting assertion failures from mock verification (similar to Go’s testing.T).

Implement this for your test context: typically errorf records a message and fail_now marks the test as failed or aborts the current check.

§Examples

use suitecase::mock::TestingT;

struct Counting;

impl TestingT for Counting {
    fn errorf(&self, _: &str) {}
    fn fail_now(&self) {}
}

Required Methods§

Source

fn errorf(&self, msg: &str)

Records a failure message (e.g. log or buffer).

Source

fn fail_now(&self)

Marks the current test or assertion as failed (for example by panicking or setting a flag).

Implementors§