test: EventTracker::get_matching_opt: Return the first matching event, not last

This commit is contained in:
iequidoo
2026-04-24 20:27:23 -03:00
parent 1ab6645bbc
commit d1e2eb4dc9

View File

@@ -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<F: Fn(&EventType) -> 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);
}
}
}