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_each
The callback to execute before each testafter_each
The 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
actual
The actual valueexpected
The 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
c
The 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
c
The 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
actual
The actual lenexpected
The 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
actual
The actual valueexpected
The 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
actual
The actual valueexpected
The 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
actual
The actual valueexpected
The 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
actual
The actual valueexpected
The 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
actual
The actual valueexpected
The expected value
Sourcepub fn exists(self, actual: &str) -> Self
pub fn exists(self, actual: &str) -> Self
§Check if an actual path exists
actual
The 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
actual
The actual valueexpected
The 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
actual
The actual valueexpected
The 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
actual
The actual valueexpected
The 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
actual
The callback to checkexpected
The 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
c
The theorem callbackexpected
The 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
c
The theorem callbackexpected
The 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
c
The theorem callbackexpected
The 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