Skip to content

Commit

Permalink
Remove assert_compont_eq
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-i-cecile committed Feb 7, 2022
1 parent 3718e00 commit f241492
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 110 deletions.
1 change: 0 additions & 1 deletion crates/bevy_app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ mod app;
mod plugin;
mod plugin_group;
mod schedule_runner;
mod testing_tools;

#[cfg(feature = "bevy_ci_testing")]
mod ci_testing;
Expand Down
71 changes: 0 additions & 71 deletions crates/bevy_app/src/testing_tools.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/bevy_ecs/src/world/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
mod entity_ref;
mod spawn_batch;
mod testing_tools;
mod world_cell;

pub use crate::change_detection::Mut;
Expand Down
34 changes: 0 additions & 34 deletions crates/bevy_ecs/src/world/testing_tools.rs

This file was deleted.

12 changes: 9 additions & 3 deletions tests/integration_testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,18 @@ fn player_does_not_fall_through_floor() {

// The player should start on the floor
app.update();
app.assert_component_eq::<Transform, With<Player>>(&Transform::from_xyz(0.0, 0.0, 0.0));
let mut query_state = app.world.query_filtered::<&Transform, With<Player>>();
let player_transform = query_state.iter(&app.world).next().unwrap();
assert_eq!(player_transform, &Transform::from_xyz(0.0, 0.0, 0.0));

// Even after some time, the player should not fall through the floor
for _ in 0..3 {
app.update();
}

app.assert_component_eq::<Transform, With<Player>>(&Transform::from_xyz(0.0, 0.0, 0.0));
let mut query_state = app.world.query_filtered::<&Transform, With<Player>>();
let player_transform = query_state.iter(&app.world).next().unwrap();
assert_eq!(player_transform, &Transform::from_xyz(0.0, 0.0, 0.0));

// If we drop the player from a height, they should eventually come to rest on the floor
let mut player_query = app.world.query_filtered::<&mut Transform, With<Player>>();
Expand All @@ -191,7 +195,9 @@ fn player_does_not_fall_through_floor() {
}

// The player should have landed by now
app.assert_component_eq::<Transform, With<Player>>(&Transform::from_xyz(0.0, 0.0, 0.0));
let mut query_state = app.world.query_filtered::<&Transform, With<Player>>();
let player_transform = query_state.iter(&app.world).next().unwrap();
assert_eq!(player_transform, &Transform::from_xyz(0.0, 0.0, 0.0));
}

#[test]
Expand Down

0 comments on commit f241492

Please sign in to comment.