From d1e2eb4dc908ee2fd7be27e56115bc90cddb49e3 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Fri, 24 Apr 2026 20:27:23 -0300 Subject: [PATCH] test: EventTracker::get_matching_opt: Return the first matching event, not last --- src/test_utils.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } } }