@@ -325,16 +325,17 @@ mod scheduling_event {
325
325
#[ cfg( test) ]
326
326
#[ cfg( test) ]
327
327
mod tests {
328
- use super :: scheduling_event:: * ;
329
328
use crate :: {
330
- schedule:: { SingleThreadedExecutor , Stage , SystemStage } ,
331
- system:: { NonSend , Query , Res , ResMut } ,
329
+ self as bevy_ecs,
330
+ component:: Component ,
331
+ schedule:: {
332
+ executor_parallel:: scheduling_event:: * , SingleThreadedExecutor , Stage , SystemStage ,
333
+ } ,
334
+ system:: { NonSend , Query , Res , ResMut , Resource } ,
332
335
world:: World ,
333
336
} ;
334
337
335
- use crate as bevy_ecs;
336
- use crate :: component:: Component ;
337
- use crate :: system:: Resource ;
338
+ use SchedulingEvent :: StartedSystems ;
338
339
339
340
#[ derive( Component ) ]
340
341
struct W < T > ( T ) ;
@@ -361,10 +362,7 @@ mod tests {
361
362
stage. run ( & mut world) ;
362
363
assert_eq ! (
363
364
receive_events( & world) ,
364
- vec![
365
- SchedulingEvent :: StartedSystems ( 3 ) ,
366
- SchedulingEvent :: StartedSystems ( 3 ) ,
367
- ]
365
+ vec![ StartedSystems ( 3 ) , StartedSystems ( 3 ) , ]
368
366
) ;
369
367
}
370
368
@@ -380,30 +378,21 @@ mod tests {
380
378
stage. run ( & mut world) ;
381
379
assert_eq ! (
382
380
receive_events( & world) ,
383
- vec![
384
- SchedulingEvent :: StartedSystems ( 1 ) ,
385
- SchedulingEvent :: StartedSystems ( 1 ) ,
386
- ]
381
+ vec![ StartedSystems ( 1 ) , StartedSystems ( 1 ) , ]
387
382
) ;
388
383
let mut stage = SystemStage :: parallel ( )
389
384
. with_system ( wants_mut)
390
385
. with_system ( wants_ref) ;
391
386
stage. run ( & mut world) ;
392
387
assert_eq ! (
393
388
receive_events( & world) ,
394
- vec![
395
- SchedulingEvent :: StartedSystems ( 1 ) ,
396
- SchedulingEvent :: StartedSystems ( 1 ) ,
397
- ]
389
+ vec![ StartedSystems ( 1 ) , StartedSystems ( 1 ) , ]
398
390
) ;
399
391
let mut stage = SystemStage :: parallel ( )
400
392
. with_system ( wants_ref)
401
393
. with_system ( wants_ref) ;
402
394
stage. run ( & mut world) ;
403
- assert_eq ! (
404
- receive_events( & world) ,
405
- vec![ SchedulingEvent :: StartedSystems ( 2 ) , ]
406
- ) ;
395
+ assert_eq ! ( receive_events( & world) , vec![ StartedSystems ( 2 ) , ] ) ;
407
396
}
408
397
409
398
#[ test]
@@ -418,30 +407,21 @@ mod tests {
418
407
stage. run ( & mut world) ;
419
408
assert_eq ! (
420
409
receive_events( & world) ,
421
- vec![
422
- SchedulingEvent :: StartedSystems ( 1 ) ,
423
- SchedulingEvent :: StartedSystems ( 1 ) ,
424
- ]
410
+ vec![ StartedSystems ( 1 ) , StartedSystems ( 1 ) , ]
425
411
) ;
426
412
let mut stage = SystemStage :: parallel ( )
427
413
. with_system ( wants_mut)
428
414
. with_system ( wants_ref) ;
429
415
stage. run ( & mut world) ;
430
416
assert_eq ! (
431
417
receive_events( & world) ,
432
- vec![
433
- SchedulingEvent :: StartedSystems ( 1 ) ,
434
- SchedulingEvent :: StartedSystems ( 1 ) ,
435
- ]
418
+ vec![ StartedSystems ( 1 ) , StartedSystems ( 1 ) , ]
436
419
) ;
437
420
let mut stage = SystemStage :: parallel ( )
438
421
. with_system ( wants_ref)
439
422
. with_system ( wants_ref) ;
440
423
stage. run ( & mut world) ;
441
- assert_eq ! (
442
- receive_events( & world) ,
443
- vec![ SchedulingEvent :: StartedSystems ( 2 ) , ]
444
- ) ;
424
+ assert_eq ! ( receive_events( & world) , vec![ StartedSystems ( 2 ) , ] ) ;
445
425
let mut world = World :: new ( ) ;
446
426
world. spawn ( ) . insert_bundle ( ( W ( 0usize ) , W ( 0u32 ) , W ( 0f32 ) ) ) ;
447
427
fn wants_mut_usize ( _: Query < ( & mut W < usize > , & W < f32 > ) > ) { }
@@ -450,10 +430,7 @@ mod tests {
450
430
. with_system ( wants_mut_usize)
451
431
. with_system ( wants_mut_u32) ;
452
432
stage. run ( & mut world) ;
453
- assert_eq ! (
454
- receive_events( & world) ,
455
- vec![ SchedulingEvent :: StartedSystems ( 2 ) , ]
456
- ) ;
433
+ assert_eq ! ( receive_events( & world) , vec![ StartedSystems ( 2 ) , ] ) ;
457
434
}
458
435
459
436
#[ test]
@@ -468,30 +445,21 @@ mod tests {
468
445
stage. run ( & mut world) ;
469
446
assert_eq ! (
470
447
receive_events( & world) ,
471
- vec![
472
- SchedulingEvent :: StartedSystems ( 1 ) ,
473
- SchedulingEvent :: StartedSystems ( 1 ) ,
474
- ]
448
+ vec![ StartedSystems ( 1 ) , StartedSystems ( 1 ) , ]
475
449
) ;
476
450
let mut stage = SystemStage :: parallel ( )
477
451
. with_system ( wants_mut)
478
452
. with_system ( wants_world) ;
479
453
stage. run ( & mut world) ;
480
454
assert_eq ! (
481
455
receive_events( & world) ,
482
- vec![
483
- SchedulingEvent :: StartedSystems ( 1 ) ,
484
- SchedulingEvent :: StartedSystems ( 1 ) ,
485
- ]
456
+ vec![ StartedSystems ( 1 ) , StartedSystems ( 1 ) , ]
486
457
) ;
487
458
let mut stage = SystemStage :: parallel ( )
488
459
. with_system ( wants_world)
489
460
. with_system ( wants_world) ;
490
461
stage. run ( & mut world) ;
491
- assert_eq ! (
492
- receive_events( & world) ,
493
- vec![ SchedulingEvent :: StartedSystems ( 2 ) , ]
494
- ) ;
462
+ assert_eq ! ( receive_events( & world) , vec![ StartedSystems ( 2 ) , ] ) ;
495
463
}
496
464
497
465
#[ test]
@@ -514,10 +482,10 @@ mod tests {
514
482
assert_eq ! (
515
483
receive_events( & world) ,
516
484
vec![
517
- SchedulingEvent :: StartedSystems ( 3 ) ,
518
- SchedulingEvent :: StartedSystems ( 1 ) ,
519
- SchedulingEvent :: StartedSystems ( 1 ) ,
520
- SchedulingEvent :: StartedSystems ( 1 ) ,
485
+ StartedSystems ( 3 ) ,
486
+ StartedSystems ( 1 ) ,
487
+ StartedSystems ( 1 ) ,
488
+ StartedSystems ( 1 ) ,
521
489
]
522
490
) ;
523
491
stage. set_executor ( Box :: new ( SingleThreadedExecutor :: default ( ) ) ) ;
0 commit comments