diff --git a/src/lib.rs b/src/lib.rs index b13bb8a..3d23c5c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -430,9 +430,9 @@ mod test { None } } - fn receive_events(world: &World) -> Vec { - let events = world.resource::>(); - events.iter_current_update_events().cloned().collect() + fn receive_events(world: &mut World) -> Vec { + let mut events = world.resource_mut::>(); + events.drain().collect() } /// Wrapper around `App` to make it easier to test the navigation systems. @@ -472,6 +472,7 @@ mod test { hierarchy.spawn(&mut app.world_mut()); // Run once to convert the `MenuSetting` and `MenuBuilder` into `TreeMenu`. app.update(); + let _: Vec = receive_events(&mut app.world_mut()); Self { app } }