pub struct Suite { /* private fields */ }Expand description
§Represent a test suite
Implementations§
Source§impl Suite
impl Suite
Sourcepub fn new(before_each: fn(), after_each: fn()) -> Self
pub fn new(before_each: fn(), after_each: fn()) -> Self
§Initialize the suite
before_eachThe callback to execute before each testafter_eachThe callback to execute after each test
Sourcepub fn eq<X: PartialEq>(self, actual: &X, expected: &X) -> Self
pub fn eq<X: PartialEq>(self, actual: &X, expected: &X) -> Self
§Check equality
actualThe actual valueexpectedThe expected value
Sourcepub fn panic(self, c: impl FnOnce() + UnwindSafe) -> Self
pub fn panic(self, c: impl FnOnce() + UnwindSafe) -> Self
§Check if a callback panic
cThe callback to check
Sourcepub fn not_panic(self, c: impl FnOnce() + UnwindSafe) -> Self
pub fn not_panic(self, c: impl FnOnce() + UnwindSafe) -> Self
§Check if a callback don’t panic
cThe callback to check
Sourcepub fn len<X: ExactSizeIterator>(self, actual: &X, expected: &usize) -> Self
pub fn len<X: ExactSizeIterator>(self, actual: &X, expected: &usize) -> Self
§Check the len
actualThe actual lenexpectedThe expected len
Sourcepub fn ne<X: PartialEq>(self, actual: &X, expected: &X) -> Self
pub fn ne<X: PartialEq>(self, actual: &X, expected: &X) -> Self
§Check inequality
actualThe actual valueexpectedThe expected value
Sourcepub fn gt<X: PartialOrd>(self, actual: &X, expected: &X) -> Self
pub fn gt<X: PartialOrd>(self, actual: &X, expected: &X) -> Self
§Check if actual is greater than expected
actualThe actual valueexpectedThe expected value
Sourcepub fn ge<X: PartialOrd>(self, actual: &X, expected: &X) -> Self
pub fn ge<X: PartialOrd>(self, actual: &X, expected: &X) -> Self
§Check if actual is greater or equal than expected
actualThe actual valueexpectedThe expected value
Sourcepub fn str_contains(self, actual: &str, expected: &str) -> Self
pub fn str_contains(self, actual: &str, expected: &str) -> Self
§Check if actual is containing expected
actualThe actual valueexpectedThe expected value
Sourcepub fn path_exists(self, actual: &str, expected: bool) -> Self
pub fn path_exists(self, actual: &str, expected: bool) -> Self
§Check if an actual path matches the expected value
actualThe actual valueexpectedThe expected value
Sourcepub fn exists(self, actual: &str) -> Self
pub fn exists(self, actual: &str) -> Self
§Check if an actual path exists
actualThe actual path
Sourcepub fn str_not_contains(self, actual: &str, expected: &str) -> Self
pub fn str_not_contains(self, actual: &str, expected: &str) -> Self
§Check if actual is not containing expected
actualThe actual valueexpectedThe expected value
Sourcepub fn le<X: PartialOrd>(self, actual: &X, expected: &X) -> Self
pub fn le<X: PartialOrd>(self, actual: &X, expected: &X) -> Self
§Check if actual is lower or equal than expected
actualThe actual valueexpectedThe expected value
Sourcepub fn lt<X: PartialOrd>(self, actual: &X, expected: &X) -> Self
pub fn lt<X: PartialOrd>(self, actual: &X, expected: &X) -> Self
§Check if actual is lower than expected
actualThe actual valueexpectedThe expected value
Sourcepub fn response<X: PartialEq>(
self,
title: &str,
description: &str,
c: &dyn Fn(X) -> X,
x: X,
expected: &X,
) -> Self
pub fn response<X: PartialEq>( self, title: &str, description: &str, c: &dyn Fn(X) -> X, x: X, expected: &X, ) -> Self
§Check if the callback exit code match the expected exit code
actualThe callback to checkexpectedThe expected code
Sourcepub fn theorem<X: PartialEq>(
self,
title: &str,
description: &str,
c: &dyn Fn() -> X,
expected: &X,
) -> Self
pub fn theorem<X: PartialEq>( self, title: &str, description: &str, c: &dyn Fn() -> X, expected: &X, ) -> Self
§Check if a theorem is equal to expected value
cThe theorem callbackexpectedThe expected value
Sourcepub fn theory<X: PartialEq>(
self,
title: &str,
description: &str,
callback: &X,
expected: &X,
) -> Self
pub fn theory<X: PartialEq>( self, title: &str, description: &str, callback: &X, expected: &X, ) -> Self
§Check if a theorem is equal to expected value
cThe theorem callbackexpectedThe expected value
Sourcepub fn chaos<X: PartialEq>(
self,
title: &str,
description: &str,
c: &dyn Fn() -> X,
expected: &X,
) -> Self
pub fn chaos<X: PartialEq>( self, title: &str, description: &str, c: &dyn Fn() -> X, expected: &X, ) -> Self
§Check if a theorem is different to expected
cThe theorem callbackexpectedThe expected value
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Suite
impl RefUnwindSafe for Suite
impl Send for Suite
impl Sync for Suite
impl Unpin for Suite
impl UnwindSafe for Suite
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