[][src]Macro tari_test_utils::counter_context

macro_rules! counter_context {
    ($n:ident, $c:ident) => { ... };
    ($n:ident) => { ... };
}

Creates a test counter future Context.

Usage


{
  let mut my_fut = future::ready(());
  counter_context!(cx); // cx variable in scope
  assert!(my_fut.poll_unpin(&mut cx).is_ready());
}

{
  let mut my_fut = future::ready(());
  counter_context!(cx, counter); // cx and counter variables in scope
  assert!(my_fut.poll_unpin(&mut cx).is_ready());
  assert_eq!(counter.get(), 0); // `poll` didn't call the waker
}