Skip to content

Commit

Permalink
Remove duplicate asserts in test (bevyengine#5648)
Browse files Browse the repository at this point in the history
# 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 ( bevyengine@8eb0440 ) added already existing asserts while removing others.

## Solution

Remove the duplicated asserts.
  • Loading branch information
BorisBoutillier committed Aug 15, 2022
1 parent 5ba5c8e commit a70b9c5
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions crates/bevy_hierarchy/src/child_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,6 @@ mod tests {
);
assert_eq!(*world.get::<Parent>(child3).unwrap(), Parent(parent));
assert_eq!(*world.get::<Parent>(child4).unwrap(), Parent(parent));
assert_eq!(*world.get::<Parent>(child3).unwrap(), Parent(parent));
assert_eq!(*world.get::<Parent>(child4).unwrap(), Parent(parent));

let remove_children = [child1, child4];
{
Expand Down Expand Up @@ -641,9 +639,6 @@ mod tests {
assert_eq!(*world.get::<Parent>(child1).unwrap(), Parent(parent));
assert_eq!(*world.get::<Parent>(child2).unwrap(), Parent(parent));

assert_eq!(*world.get::<Parent>(child1).unwrap(), Parent(parent));
assert_eq!(*world.get::<Parent>(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!(
Expand All @@ -652,8 +647,6 @@ mod tests {
);
assert_eq!(*world.get::<Parent>(child3).unwrap(), Parent(parent));
assert_eq!(*world.get::<Parent>(child4).unwrap(), Parent(parent));
assert_eq!(*world.get::<Parent>(child3).unwrap(), Parent(parent));
assert_eq!(*world.get::<Parent>(child4).unwrap(), Parent(parent));

let remove_children = [child1, child4];
world.entity_mut(parent).remove_children(&remove_children);
Expand Down

0 comments on commit a70b9c5

Please sign in to comment.