Macro tokio_test::assert_ready_err
source · macro_rules! assert_ready_err { ($e:expr) => { ... }; ($e:expr, $($msg:tt)+) => { ... }; }
Expand description
Asserts a Poll<Result<...>>
is ready and Err
, returning the error.
This will invoke panic!
if the provided Poll
does not evaluate to Poll::Ready(Err(..))
at
runtime.
§Custom Messages
This macro has a second form, where a custom panic message can be provided with or without arguments for formatting.
§Examples
use futures_util::future;
use tokio_test::{assert_ready_err, task};
let mut fut = task::spawn(future::err::<(), _>(()));
assert_ready_err!(fut.poll());