Available on crate feature
test-util
only.Expand description
Test utilities for time and sleep
Modules§
- tick_
advance_ sleep - Test time/sleep implementations that work by manually advancing time with a
tick()
Structs§
- Captured
Sleep - Guard returned from
SleepGate::expect_sleep
- Controlled
Sleep - A sleep implementation where calls to
AsyncSleep::sleep
block untilSleepGate::expect_sleep
is called - Instant
Sleep - A sleep implementation where calls to
AsyncSleep::sleep
will complete instantly. - Manual
Time Source - Manually controlled time source
- Sleep
Gate - Gate that allows
ControlledSleep
to advance.
Functions§
- controlled_
time_ and_ sleep - Returns a trio of tools to test interactions with time
- instant_
time_ and_ sleep - Returns a duo of tools to test interactions with time. Sleeps will end instantly, but the desired length of the sleeps will be recorded for later verification.