Skip to content

Commit

Permalink
fixed more tests
Browse files Browse the repository at this point in the history
Allocation order is not guaranteed. This test did not reflect that.
  • Loading branch information
ElliottjPierce committed Mar 11, 2025
1 parent 281f5b9 commit 28ae3e2
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions crates/bevy_ecs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,9 @@ mod tests {
results.lock().unwrap().push((e, i));
});
results.lock().unwrap().sort();
assert_eq!(
&*results.lock().unwrap(),
&[(e1, 1), (e2, 2), (e3, 3), (e4, 4), (e5, 5)]
);
let mut expected = vec![(e1, 1), (e2, 2), (e3, 3), (e4, 4), (e5, 5)];
expected.sort();
assert_eq!(&*results.lock().unwrap(), &expected);
}

#[test]
Expand All @@ -510,10 +509,9 @@ mod tests {
.par_iter(&world)
.for_each(|(e, &SparseStored(i))| results.lock().unwrap().push((e, i)));
results.lock().unwrap().sort();
assert_eq!(
&*results.lock().unwrap(),
&[(e1, 1), (e2, 2), (e3, 3), (e4, 4), (e5, 5)]
);
let mut expected = vec![(e1, 1), (e2, 2), (e3, 3), (e4, 4), (e5, 5)];
expected.sort();
assert_eq!(&*results.lock().unwrap(), &expected);
}

#[test]
Expand Down

0 comments on commit 28ae3e2

Please sign in to comment.