From 4a16c0c3dd09d502d639e4a58af05087d07fa6bf 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 5f5ad18c3..35d144f07 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -1467,7 +1467,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, @@ -1481,7 +1481,7 @@ impl EventTracker { return found_event; } if event_matcher(&event.typ) { - found_event = Some(event.typ); + found_event.get_or_insert(event.typ); } } }