@@ -35,7 +35,7 @@ impl TestOpts {
35
35
fn new ( ) -> TestOpts {
36
36
TestOpts {
37
37
list : false ,
38
- filter : None ,
38
+ filters : vec ! [ ] ,
39
39
filter_exact : false ,
40
40
force_run_in_process : false ,
41
41
exclude_should_panic : false ,
@@ -469,43 +469,60 @@ pub fn exact_filter_match() {
469
469
}
470
470
471
471
let substr =
472
- filter_tests ( & TestOpts { filter : Some ( "base" . into ( ) ) , ..TestOpts :: new ( ) } , tests ( ) ) ;
472
+ filter_tests ( & TestOpts { filters : vec ! [ "base" . into( ) ] , ..TestOpts :: new ( ) } , tests ( ) ) ;
473
473
assert_eq ! ( substr. len( ) , 4 ) ;
474
474
475
- let substr = filter_tests ( & TestOpts { filter : Some ( "bas" . into ( ) ) , ..TestOpts :: new ( ) } , tests ( ) ) ;
475
+ let substr =
476
+ filter_tests ( & TestOpts { filters : vec ! [ "bas" . into( ) ] , ..TestOpts :: new ( ) } , tests ( ) ) ;
476
477
assert_eq ! ( substr. len( ) , 4 ) ;
477
478
478
479
let substr =
479
- filter_tests ( & TestOpts { filter : Some ( "::test" . into ( ) ) , ..TestOpts :: new ( ) } , tests ( ) ) ;
480
+ filter_tests ( & TestOpts { filters : vec ! [ "::test" . into( ) ] , ..TestOpts :: new ( ) } , tests ( ) ) ;
480
481
assert_eq ! ( substr. len( ) , 3 ) ;
481
482
482
483
let substr =
483
- filter_tests ( & TestOpts { filter : Some ( "base::test" . into ( ) ) , ..TestOpts :: new ( ) } , tests ( ) ) ;
484
+ filter_tests ( & TestOpts { filters : vec ! [ "base::test" . into( ) ] , ..TestOpts :: new ( ) } , tests ( ) ) ;
484
485
assert_eq ! ( substr. len( ) , 3 ) ;
485
486
487
+ let substr = filter_tests (
488
+ & TestOpts { filters : vec ! [ "test1" . into( ) , "test2" . into( ) ] , ..TestOpts :: new ( ) } ,
489
+ tests ( ) ,
490
+ ) ;
491
+ assert_eq ! ( substr. len( ) , 2 ) ;
492
+
486
493
let exact = filter_tests (
487
- & TestOpts { filter : Some ( "base" . into ( ) ) , filter_exact : true , ..TestOpts :: new ( ) } ,
494
+ & TestOpts { filters : vec ! [ "base" . into( ) ] , filter_exact : true , ..TestOpts :: new ( ) } ,
488
495
tests ( ) ,
489
496
) ;
490
497
assert_eq ! ( exact. len( ) , 1 ) ;
491
498
492
499
let exact = filter_tests (
493
- & TestOpts { filter : Some ( "bas" . into ( ) ) , filter_exact : true , ..TestOpts :: new ( ) } ,
500
+ & TestOpts { filters : vec ! [ "bas" . into( ) ] , filter_exact : true , ..TestOpts :: new ( ) } ,
494
501
tests ( ) ,
495
502
) ;
496
503
assert_eq ! ( exact. len( ) , 0 ) ;
497
504
498
505
let exact = filter_tests (
499
- & TestOpts { filter : Some ( "::test" . into ( ) ) , filter_exact : true , ..TestOpts :: new ( ) } ,
506
+ & TestOpts { filters : vec ! [ "::test" . into( ) ] , filter_exact : true , ..TestOpts :: new ( ) } ,
500
507
tests ( ) ,
501
508
) ;
502
509
assert_eq ! ( exact. len( ) , 0 ) ;
503
510
504
511
let exact = filter_tests (
505
- & TestOpts { filter : Some ( "base::test" . into ( ) ) , filter_exact : true , ..TestOpts :: new ( ) } ,
512
+ & TestOpts { filters : vec ! [ "base::test" . into( ) ] , filter_exact : true , ..TestOpts :: new ( ) } ,
506
513
tests ( ) ,
507
514
) ;
508
515
assert_eq ! ( exact. len( ) , 1 ) ;
516
+
517
+ let exact = filter_tests (
518
+ & TestOpts {
519
+ filters : vec ! [ "base" . into( ) , "base::test" . into( ) ] ,
520
+ filter_exact : true ,
521
+ ..TestOpts :: new ( )
522
+ } ,
523
+ tests ( ) ,
524
+ ) ;
525
+ assert_eq ! ( exact. len( ) , 2 ) ;
509
526
}
510
527
511
528
#[ test]
0 commit comments