Function assert_cancel_safe_async

Source
pub async fn assert_cancel_safe_async<F, T, P, FutStep>(
    mk: impl FnMut() -> F,
    expected: &T,
    on_pending: P,
)
where F: Future<Output = T>, T: Debug + PartialEq, P: FnMut() -> FutStep, FutStep: Future<Output = ()>,
Expand description

Cancel-safety check for async futures. On every Poll::Pending, runs on_pending().await to drive external progress (e.g. advancing a paused clock or IO). Cancels at each yield boundary and ensures a fresh run still produces expected.