pub struct TestRunner<M: Model> { /* private fields */ }Expand description
A test runner that provides utilities for testing hojicha applications
Implementations§
Source§impl<M: Model> TestRunner<M>
impl<M: Model> TestRunner<M>
Sourcepub fn with_options(model: M, options: ProgramOptions) -> Result<Self>
pub fn with_options(model: M, options: ProgramOptions) -> Result<Self>
Create a new test runner with custom options
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set the timeout for test execution
Sourcepub fn without_timeout(self) -> Self
pub fn without_timeout(self) -> Self
Run without any timeout (be careful - may hang!)
Sourcepub fn init_async_bridge(&mut self) -> SyncSender<Event<M::Message>>
pub fn init_async_bridge(&mut self) -> SyncSender<Event<M::Message>>
Initialize the async bridge and return a sender
Sourcepub fn sender(&self) -> Option<SyncSender<Event<M::Message>>>
pub fn sender(&self) -> Option<SyncSender<Event<M::Message>>>
Get a sender if async bridge was initialized
Sourcepub fn send_message(&self, msg: M::Message) -> Result<()>
pub fn send_message(&self, msg: M::Message) -> Result<()>
Send a message to the program
Sourcepub fn run_for_updates(self, count: usize) -> Result<()>
pub fn run_for_updates(self, count: usize) -> Result<()>
Run for a specific number of update cycles
Auto Trait Implementations§
impl<M> Freeze for TestRunner<M>where
M: Freeze,
impl<M> !RefUnwindSafe for TestRunner<M>
impl<M> Send for TestRunner<M>where
M: Send,
impl<M> !Sync for TestRunner<M>
impl<M> Unpin for TestRunner<M>where
M: Unpin,
impl<M> !UnwindSafe for TestRunner<M>
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> Inspectable for T
impl<T> Inspectable for T
Source§fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
Conditionally inspect this value
Source§fn inspect_with<F>(self, label: &str, f: F) -> Self
fn inspect_with<F>(self, label: &str, f: F) -> Self
Inspect with a custom formatter