@@ -19,7 +19,6 @@ pub use transitions::*;
19
19
mod tests {
20
20
use bevy_ecs:: event:: EventRegistry ;
21
21
use bevy_ecs:: prelude:: * ;
22
- use bevy_ecs:: schedule:: ScheduleLabel ;
23
22
use bevy_state_macros:: States ;
24
23
use bevy_state_macros:: SubStates ;
25
24
@@ -64,7 +63,7 @@ mod tests {
64
63
65
64
world. insert_resource ( schedules) ;
66
65
67
- setup_state_transitions_in_world ( & mut world, None ) ;
66
+ setup_state_transitions_in_world ( & mut world) ;
68
67
69
68
world. run_schedule ( StateTransition ) ;
70
69
assert_eq ! ( world. resource:: <State <SimpleState >>( ) . 0 , SimpleState :: A ) ;
@@ -120,7 +119,7 @@ mod tests {
120
119
121
120
world. insert_resource ( schedules) ;
122
121
123
- setup_state_transitions_in_world ( & mut world, None ) ;
122
+ setup_state_transitions_in_world ( & mut world) ;
124
123
125
124
world. run_schedule ( StateTransition ) ;
126
125
assert_eq ! ( world. resource:: <State <SimpleState >>( ) . 0 , SimpleState :: A ) ;
@@ -180,7 +179,7 @@ mod tests {
180
179
181
180
world. insert_resource ( schedules) ;
182
181
183
- setup_state_transitions_in_world ( & mut world, None ) ;
182
+ setup_state_transitions_in_world ( & mut world) ;
184
183
185
184
world. run_schedule ( StateTransition ) ;
186
185
assert_eq ! ( world. resource:: <State <SimpleState >>( ) . 0 , SimpleState :: A ) ;
@@ -275,7 +274,7 @@ mod tests {
275
274
276
275
world. insert_resource ( schedules) ;
277
276
278
- setup_state_transitions_in_world ( & mut world, None ) ;
277
+ setup_state_transitions_in_world ( & mut world) ;
279
278
280
279
world. run_schedule ( StateTransition ) ;
281
280
assert_eq ! ( world. resource:: <State <SimpleState >>( ) . 0 , SimpleState :: A ) ;
@@ -354,9 +353,6 @@ mod tests {
354
353
}
355
354
}
356
355
357
- #[ derive( ScheduleLabel , Clone , Debug , PartialEq , Eq , Hash ) ]
358
- struct Startup ;
359
-
360
356
#[ test]
361
357
fn computed_state_transitions_are_produced_correctly ( ) {
362
358
let mut world = World :: new ( ) ;
@@ -367,7 +363,7 @@ mod tests {
367
363
world. init_resource :: < State < SimpleState2 > > ( ) ;
368
364
world. init_resource :: < Schedules > ( ) ;
369
365
370
- setup_state_transitions_in_world ( & mut world, Some ( Startup . intern ( ) ) ) ;
366
+ setup_state_transitions_in_world ( & mut world) ;
371
367
372
368
let mut schedules = world
373
369
. get_resource_mut :: < Schedules > ( )
@@ -431,7 +427,7 @@ mod tests {
431
427
432
428
world. init_resource :: < ComputedStateTransitionCounter > ( ) ;
433
429
434
- setup_state_transitions_in_world ( & mut world, None ) ;
430
+ setup_state_transitions_in_world ( & mut world) ;
435
431
436
432
assert_eq ! ( world. resource:: <State <SimpleState >>( ) . 0 , SimpleState :: A ) ;
437
433
assert_eq ! ( world. resource:: <State <SimpleState2 >>( ) . 0 , SimpleState2 :: A1 ) ;
@@ -508,7 +504,7 @@ mod tests {
508
504
#[ test]
509
505
fn same_state_transition_should_emit_event_and_not_run_schedules ( ) {
510
506
let mut world = World :: new ( ) ;
511
- setup_state_transitions_in_world ( & mut world, None ) ;
507
+ setup_state_transitions_in_world ( & mut world) ;
512
508
EventRegistry :: register_event :: < StateTransitionEvent < SimpleState > > ( & mut world) ;
513
509
world. init_resource :: < State < SimpleState > > ( ) ;
514
510
let mut schedules = world. resource_mut :: < Schedules > ( ) ;
@@ -568,7 +564,7 @@ mod tests {
568
564
SubState :: register_sub_state_systems ( & mut apply_changes) ;
569
565
schedules. insert ( apply_changes) ;
570
566
world. insert_resource ( schedules) ;
571
- setup_state_transitions_in_world ( & mut world, None ) ;
567
+ setup_state_transitions_in_world ( & mut world) ;
572
568
573
569
world. insert_resource ( NextState :: Pending ( SimpleState :: B ( true ) ) ) ;
574
570
world. run_schedule ( StateTransition ) ;
@@ -599,7 +595,7 @@ mod tests {
599
595
TestComputedState :: register_computed_state_systems ( & mut apply_changes) ;
600
596
schedules. insert ( apply_changes) ;
601
597
world. insert_resource ( schedules) ;
602
- setup_state_transitions_in_world ( & mut world, None ) ;
598
+ setup_state_transitions_in_world ( & mut world) ;
603
599
604
600
world. insert_resource ( NextState :: Pending ( SimpleState :: B ( true ) ) ) ;
605
601
world. run_schedule ( StateTransition ) ;
@@ -651,7 +647,7 @@ mod tests {
651
647
#[ test]
652
648
fn check_transition_orders ( ) {
653
649
let mut world = World :: new ( ) ;
654
- setup_state_transitions_in_world ( & mut world, None ) ;
650
+ setup_state_transitions_in_world ( & mut world) ;
655
651
EventRegistry :: register_event :: < StateTransitionEvent < SimpleState > > ( & mut world) ;
656
652
EventRegistry :: register_event :: < StateTransitionEvent < SubState > > ( & mut world) ;
657
653
EventRegistry :: register_event :: < StateTransitionEvent < TransitionTestingComputedState > > (
0 commit comments