Skip to content

Commit 3ca0a5d

Browse files
Fix broken tests
1 parent 33db507 commit 3ca0a5d

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

crates/bevy_ecs/src/schedule/ambiguity_detection.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ impl SystemStage {
460460
}
461461
}
462462

463-
/// Collapses a name returned by std::any::type_name to remove its module path
463+
/// Collapses a name returned by [`std::any::type_name`] to remove its module path
464464
fn format_type_name(raw_name: &str) -> String {
465465
// Generics result in nested paths within <..> blocks
466466
// Consider "bevy_render::camera::camera::extract_cameras<bevy_render::camera::bundle::Camera3d>"
@@ -781,7 +781,7 @@ mod tests {
781781
.add_system(res_system);
782782

783783
assert_eq!(
784-
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Forbid),
784+
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Warn),
785785
0
786786
);
787787
}
@@ -795,7 +795,21 @@ mod tests {
795795
.add_system(res_system.label("IGNORE_ME"));
796796

797797
assert_eq!(
798-
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Forbid),
798+
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Warn),
799+
0
800+
);
801+
}
802+
803+
#[test]
804+
fn ambiguous_with_system() {
805+
let mut world = World::new();
806+
let mut test_stage = SystemStage::parallel();
807+
test_stage
808+
.add_system(system_a.ambiguous_with(system_b))
809+
.add_system(system_b);
810+
811+
assert_eq!(
812+
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Warn),
799813
0
800814
);
801815
}
@@ -824,51 +838,37 @@ mod tests {
824838
}
825839

826840
#[test]
827-
fn ambiguous_with_system() {
828-
let mut world = World::new();
829-
let mut test_stage = SystemStage::parallel();
830-
test_stage
831-
.add_system(system_a.ambiguous_with(system_b))
832-
.add_system(system_b);
833-
834-
assert_eq!(
835-
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Forbid),
836-
0
837-
);
838-
}
839-
840-
#[test]
841-
fn off() {
841+
fn allow() {
842842
let mut world = World::new();
843843
let mut test_stage = make_test_stage(&mut world);
844844
assert_eq!(
845-
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Forbid),
845+
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Allow),
846846
0
847847
);
848848
}
849849

850850
#[test]
851-
fn minimal() {
851+
fn warn() {
852852
let mut world = World::new();
853853
let mut test_stage = make_test_stage(&mut world);
854854
assert_eq!(
855-
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Forbid),
855+
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Warn),
856856
2
857857
);
858858
}
859859

860860
#[test]
861-
fn verbose() {
861+
fn warn_verbose() {
862862
let mut world = World::new();
863863
let mut test_stage = make_test_stage(&mut world);
864864
assert_eq!(
865-
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Forbid),
865+
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::WarnVerbose),
866866
2
867867
);
868868
}
869869

870870
#[test]
871-
fn deterministic() {
871+
fn forbid() {
872872
let mut world = World::new();
873873
let mut test_stage = make_test_stage(&mut world);
874874
assert_eq!(

0 commit comments

Comments
 (0)