@@ -606,7 +606,7 @@ fn check_virtual_all_implied() {
606606}
607607
608608#[ test]
609- fn all_targets_with_and_without ( ) {
609+ fn targets_selected_default ( ) {
610610 let foo = project ( "foo" )
611611 . file ( "Cargo.toml" , SIMPLE_MANIFEST )
612612 . file ( "src/main.rs" , "fn main() {}" )
@@ -617,25 +617,37 @@ fn all_targets_with_and_without() {
617617 . build ( ) ;
618618
619619 assert_that (
620- foo. cargo ( "check" ) . arg ( "--all-targets" ) . arg ( "- v") ,
620+ foo. cargo ( "check" ) . arg ( "-v" ) ,
621621 execs ( )
622622 . with_status ( 0 )
623623 . with_stderr_contains ( "[..] --crate-name foo src[/]lib.rs [..]" )
624624 . with_stderr_contains ( "[..] --crate-name foo src[/]main.rs [..]" )
625- . with_stderr_contains ( "[..] --crate-name example1 examples[/]example1.rs [..]" )
626- . with_stderr_contains ( "[..] --crate-name test2 tests[/]test2.rs [..]" )
627- . with_stderr_contains ( "[..] --crate-name bench3 benches[/]bench3.rs [..]" ) ,
625+ . with_stderr_does_not_contain ( "[..] --crate-name example1 examples[/]example1.rs [..]" )
626+ . with_stderr_does_not_contain ( "[..] --crate-name test2 tests[/]test2.rs [..]" )
627+ . with_stderr_does_not_contain ( "[..] --crate-name bench3 benches[/]bench3.rs [..]" ) ,
628628 ) ;
629- assert_that ( foo. cargo ( "clean" ) , execs ( ) . with_status ( 0 ) ) ;
629+ }
630+
631+ #[ test]
632+ fn targets_selected_all ( ) {
633+ let foo = project ( "foo" )
634+ . file ( "Cargo.toml" , SIMPLE_MANIFEST )
635+ . file ( "src/main.rs" , "fn main() {}" )
636+ . file ( "src/lib.rs" , "pub fn smth() {}" )
637+ . file ( "examples/example1.rs" , "fn main() {}" )
638+ . file ( "tests/test2.rs" , "#[test] fn t() {}" )
639+ . file ( "benches/bench3.rs" , "" )
640+ . build ( ) ;
641+
630642 assert_that (
631- foo. cargo ( "check" ) . arg ( "-v" ) ,
643+ foo. cargo ( "check" ) . arg ( "--all-targets" ) . arg ( "- v") ,
632644 execs ( )
633645 . with_status ( 0 )
634646 . with_stderr_contains ( "[..] --crate-name foo src[/]lib.rs [..]" )
635647 . with_stderr_contains ( "[..] --crate-name foo src[/]main.rs [..]" )
636- . with_stderr_does_not_contain ( "[..] --crate-name example1 examples[/]example1.rs [..]" )
637- . with_stderr_does_not_contain ( "[..] --crate-name test2 tests[/]test2.rs [..]" )
638- . with_stderr_does_not_contain ( "[..] --crate-name bench3 benches[/]bench3.rs [..]" ) ,
648+ . with_stderr_contains ( "[..] --crate-name example1 examples[/]example1.rs [..]" )
649+ . with_stderr_contains ( "[..] --crate-name test2 tests[/]test2.rs [..]" )
650+ . with_stderr_contains ( "[..] --crate-name bench3 benches[/]bench3.rs [..]" ) ,
639651 ) ;
640652}
641653
0 commit comments