find_emitted

Macro find_emitted 

Source
macro_rules! find_emitted {
    ($actions:expr, $pattern:pat $(if $guard:expr)?) => { ... };
}
Expand description

Find and return the first action matching a pattern.

§Example

use tui_dispatch::testing::find_emitted;

let actions = harness.drain_emitted();
if let Some(Action::SetValue(v)) = find_emitted!(actions, Action::SetValue(_)) {
    assert_eq!(*v, 42);
}