pub struct SimTest { /* private fields */ }Expand description
Builder for one seeded test. See the module docs.
Implementations§
Source§impl SimTest
impl SimTest
pub fn new() -> Self
Sourcepub fn named(self, package: &str, module: &str, function: &str) -> Self
pub fn named(self, package: &str, module: &str, function: &str) -> Self
Where the test lives, for the replay command: the package name, the
test’s module_path!() and its function name.
Sourcepub fn seeds(self, seeds: Range<u64>) -> Self
pub fn seeds(self, seeds: Range<u64>) -> Self
Seeds to run under simulation (default 0..SPAWNED_SIM_SEEDS, or 0..8).
Sourcepub fn explore(self, strategy: &str) -> Self
pub fn explore(self, strategy: &str) -> Self
Under simulation, choose tasks with this strategy (random,
pct[:d=3][,k=N], dfs[:bound=2][,depth=N]); SPAWNED_SIM_STRATEGY
overrides it. Ignored on Tokio.
Sourcepub fn iterations(self, runs: usize) -> Self
pub fn iterations(self, runs: usize) -> Self
Under simulation, how many runs the strategy may spend (for random,
seeds 0..n unless SimTest::seeds is set); SPAWNED_SIM_ITERATIONS
overrides it. Ignored on Tokio.
Sourcepub fn multi_thread(self, workers: usize) -> Self
pub fn multi_thread(self, workers: usize) -> Self
On Tokio, use a multi-thread runtime with workers workers (the
default is a current-thread runtime, as #[tokio::test]). Ignored
under simulation, which always has one thread.
pub fn run<F, Fut>(self, body: F)
Trait Implementations§
Auto Trait Implementations§
impl Forget for SimTest
impl Freeze for SimTest
impl RefUnwindSafe for SimTest
impl Send for SimTest
impl Sync for SimTest
impl Unpin for SimTest
impl UnsafeUnpin for SimTest
impl UnwindSafe for SimTest
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