From a70b9c596978f3f6ddbd68669a9af75a65daedc0 Mon Sep 17 00:00:00 2001 From: Boutillier Date: Mon, 15 Aug 2022 23:03:42 +0000 Subject: [PATCH] Remove duplicate asserts in test (#5648) # Objective While poking around the hierarchy code, I wondered why some asserts in tests were duplicated. Some git blame later, I found out that commit ( https://github.com/bevyengine/bevy/commit/8eb0440f1ed0f075ed488e7efa36ba0f8bb37cad ) added already existing asserts while removing others. ## Solution Remove the duplicated asserts. --- crates/bevy_hierarchy/src/child_builder.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/crates/bevy_hierarchy/src/child_builder.rs b/crates/bevy_hierarchy/src/child_builder.rs index 2fc9fa2d0d..c7334a3d9b 100644 --- a/crates/bevy_hierarchy/src/child_builder.rs +++ b/crates/bevy_hierarchy/src/child_builder.rs @@ -599,8 +599,6 @@ mod tests { ); assert_eq!(*world.get::(child3).unwrap(), Parent(parent)); assert_eq!(*world.get::(child4).unwrap(), Parent(parent)); - assert_eq!(*world.get::(child3).unwrap(), Parent(parent)); - assert_eq!(*world.get::(child4).unwrap(), Parent(parent)); let remove_children = [child1, child4]; { @@ -641,9 +639,6 @@ mod tests { assert_eq!(*world.get::(child1).unwrap(), Parent(parent)); assert_eq!(*world.get::(child2).unwrap(), Parent(parent)); - assert_eq!(*world.get::(child1).unwrap(), Parent(parent)); - assert_eq!(*world.get::(child2).unwrap(), Parent(parent)); - world.entity_mut(parent).insert_children(1, &entities[3..]); let expected_children: SmallVec<[Entity; 8]> = smallvec![child1, child3, child4, child2]; assert_eq!( @@ -652,8 +647,6 @@ mod tests { ); assert_eq!(*world.get::(child3).unwrap(), Parent(parent)); assert_eq!(*world.get::(child4).unwrap(), Parent(parent)); - assert_eq!(*world.get::(child3).unwrap(), Parent(parent)); - assert_eq!(*world.get::(child4).unwrap(), Parent(parent)); let remove_children = [child1, child4]; world.entity_mut(parent).remove_children(&remove_children);