Macro tokio_test::assert_ready_eq[][src]

macro_rules! assert_ready_eq {
    ($e:expr, $expect:expr) => { ... };
    ($e:expr, $expect:expr, $($msg:tt)+) => { ... };
}

Asserts if a poll is ready and check for equality on the value

This will invoke panic! if the provided Poll does not evaluate to Poll::Ready at runtime and the value produced does not partially equal the expected value.

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_eq, task};

let mut fut = task::spawn(future::ready(42));
assert_ready_eq!(fut.poll(), 42);