macro_rules! assert_pending { ($a:expr $(,)?) => { ... }; ($a:expr, $($message:tt)+) => { ... }; }
Expand description
Assert an expression is Pending.
Pseudocode:
a is Pending
-
If true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
use assertables::*;
use std::task::Poll;
use std::task::Poll::*;
let a: Poll<i8> = Pending;
assert_pending!(a);
let a: Poll<i8> = Ready(1);
assert_pending!(a);
// assertion failed: `assert_pending!(a)`
// https://docs.rs/assertables/8.10.1/assertables/macro.assert_pending.html
// a label: `a`,
// a debug: `Ready(1)`