Skip to content

Commit

Permalink
WIP: fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett committed Jun 3, 2024
1 parent 458759d commit d742bf2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@ mod test {
None
}
}
fn receive_events<E: Event + Clone>(world: &World) -> Vec<E> {
let events = world.resource::<Events<E>>();
events.iter_current_update_events().cloned().collect()
fn receive_events<E: Event + Clone>(world: &mut World) -> Vec<E> {
let mut events = world.resource_mut::<Events<E>>();
events.drain().collect()
}

/// Wrapper around `App` to make it easier to test the navigation systems.
Expand Down Expand Up @@ -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<NavEvent> = receive_events(&mut app.world_mut());

Self { app }
}
Expand Down

0 comments on commit d742bf2

Please sign in to comment.