pub struct VanillaTest { /* private fields */ }Expand description
A single-use, sequential test suite.
The normal lifecycle is expects → pass or fail → done, repeated as
needed, followed by one report. Calling done without a decision records
a failure. Repeated decisions preserve the first outcome.
Implementations§
Source§impl VanillaTest
impl VanillaTest
Sourcepub fn expects(&mut self, description: &str) -> Result<(), TestError>
pub fn expects(&mut self, description: &str) -> Result<(), TestError>
Starts one uniquely described test.
Sourcepub fn pass(&mut self) -> Result<(), TestError>
pub fn pass(&mut self) -> Result<(), TestError>
Records the active test as passed. The first decision wins.
Sourcepub fn fail(&mut self) -> Result<(), TestError>
pub fn fail(&mut self) -> Result<(), TestError>
Records the active test as failed. The first decision wins.
Sourcepub fn done(&mut self) -> Result<(), TestError>
pub fn done(&mut self) -> Result<(), TestError>
Completes the active test, failing it if no decision was recorded.
Sourcepub fn report(&mut self) -> Result<&TestResult, TestError>
pub fn report(&mut self) -> Result<&TestResult, TestError>
Seals the suite and returns its cached immutable result.
Repeated calls return the same result. Reporting an empty suite succeeds.
Trait Implementations§
Source§impl Default for VanillaTest
impl Default for VanillaTest
Source§fn default() -> VanillaTest
fn default() -> VanillaTest
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for VanillaTest
impl RefUnwindSafe for VanillaTest
impl Send for VanillaTest
impl Sync for VanillaTest
impl Unpin for VanillaTest
impl UnsafeUnpin for VanillaTest
impl UnwindSafe for VanillaTest
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