macro_rules! repeated_assert {
($repetitions:expr, $delay:expr; $($tt:tt)*) => { ... };
($repetitions:expr, $delay:expr, $repetitions_catch:expr, $catch:block; $($tt:tt)*) => { ... };
}๐Deprecated since 0.2.0: Use
repeated_assert::that or repeated_assert::with_catch instead.Expand description
An assertion macro that tries to assert expressions multiple times
ยงExamples
Wait for a file to appear, calculate the checksum and then assert the checksum is to equal to 1234 (re-try up to 10 times, wait 50 ms between tries)
โ
repeated_assert!{ 10, Duration::from_millis(50);
if Path::new("should_appear_soon.txt").exists();
let checksum = crc("should_appear_soon.txt");
eq checksum, 1234;
};