pub struct SystemTester<State> { /* private fields */ }
Expand description
SystemTester
is similar to SimpleTester
, but allows to
supply test functions that accept also modifiable system state.
Implementations§
Source§impl<State> SystemTester<State>
impl<State> SystemTester<State>
Sourcepub fn add<T, F, R>(&mut self, test: F)where
T: 'static + DeserializeOwned + UnwindSafe + Clone,
F: FnMut(&mut State, T) -> R + 'static,
R: 'static + Serialize,
pub fn add<T, F, R>(&mut self, test: F)where
T: 'static + DeserializeOwned + UnwindSafe + Clone,
F: FnMut(&mut State, T) -> R + 'static,
R: 'static + Serialize,
Add a test function to the tester.
Sourcepub fn add_fn<T, F, R>(&mut self, test: F)where
T: 'static + UnwindSafe + Clone,
F: FnMut(&mut State, T) -> R + 'static,
R: 'static + Serialize,
pub fn add_fn<T, F, R>(&mut self, test: F)where
T: 'static + UnwindSafe + Clone,
F: FnMut(&mut State, T) -> R + 'static,
R: 'static + Serialize,
Add to the tester a test function that can accept closures as input.
Sourcepub fn test(&mut self, state: &mut State, input: &dyn Any) -> TestResult
pub fn test(&mut self, state: &mut State, input: &dyn Any) -> TestResult
Run the test functions on the provided system and input.
The first test function that is able to handle this kind of input,
will produce the result. If none of the defined test functions is
able to handle the input, the unhandled
result will be returned.
Trait Implementations§
Auto Trait Implementations§
impl<State> Freeze for SystemTester<State>
impl<State> !RefUnwindSafe for SystemTester<State>
impl<State> !Send for SystemTester<State>
impl<State> !Sync for SystemTester<State>
impl<State> Unpin for SystemTester<State>
impl<State> !UnwindSafe for SystemTester<State>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more