macro_rules! count_emitted { ($actions:expr, $pattern:pat $(if $guard:expr)?) => { ... }; }
Count how many actions match a pattern.
use tui_dispatch::testing::count_emitted; let actions = harness.drain_emitted(); assert_eq!(count_emitted!(actions, Action::Tick), 3);