diff --git a/src/test_utils.rs b/src/test_utils.rs index a365630b4..caece581b 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -1469,7 +1469,7 @@ impl EventTracker { .expect("timeout waiting for event match") } - /// Consumes emitted events returning the first matching one if any. + /// Consumes all emitted events returning the first matching one if any. pub async fn get_matching_opt bool>( &self, ctx: &Context, @@ -1483,7 +1483,7 @@ impl EventTracker { return found_event; } if event_matcher(&event.typ) { - found_event = Some(event.typ); + found_event.get_or_insert(event.typ); } } }