1010//! cargo test --test testsuite -- old_cargos --nocapture --ignored
1111//! ```
1212
13- #![ allow( deprecated) ]
14-
1513use std:: fs;
1614
1715use cargo:: CargoResult ;
1816use cargo_test_support:: prelude:: * ;
1917use cargo_test_support:: registry:: { self , Dependency , Package } ;
20- use cargo_test_support:: { cargo_exe, execs, paths, process, project, rustc_host} ;
18+ use cargo_test_support:: { cargo_exe, execs, paths, process, project, rustc_host, str } ;
2119use cargo_util:: { ProcessBuilder , ProcessError } ;
2220use semver:: Version ;
2321
@@ -640,32 +638,32 @@ fn index_cache_rebuild() {
640638 . with_process_builder ( tc_process ( "cargo" , "1.48.0" ) )
641639 . arg ( "check" )
642640 . cwd ( p. root ( ) )
643- . with_stderr (
644- "\
645- [UPDATING] [..]
641+ . with_stderr_data ( str![ [ r#"
642+ [UPDATING] `[ROOT]/registry` index
646643[DOWNLOADING] crates ...
647- [DOWNLOADED] bar v1.0.0 [..]
644+ [DOWNLOADED] bar v1.0.0 (registry `[ROOT]/registry`)
648645[CHECKING] bar v1.0.0
649- [CHECKING] foo v0.1.0 [..]
650- [FINISHED] [..]
651- " ,
652- )
646+ [CHECKING] foo v0.1.0 ([ROOT]/foo)
647+ [FINISHED] dev [unoptimized + debuginfo] target(s) in [ELAPSED]s
648+
649+ "# ] ] )
653650 . run ( ) ;
654651
655652 fs:: remove_file ( p. root ( ) . join ( "Cargo.lock" ) ) . unwrap ( ) ;
656653
657654 // This should rebuild the cache and use 1.0.1.
658655 p. cargo ( "check" )
659- . with_stderr (
660- "\
661- [UPDATING] [..]
656+ . with_stderr_data ( str![ [ r#"
657+ [WARNING] no edition set: defaulting to the 2015 edition while the latest is [..]
658+ [UPDATING] `dummy-registry` index
659+ [LOCKING] 2 packages to latest compatible versions
662660[DOWNLOADING] crates ...
663- [DOWNLOADED] bar v1.0.1 [..]
661+ [DOWNLOADED] bar v1.0.1 (registry `dummy-registry`)
664662[CHECKING] bar v1.0.1
665- [CHECKING] foo v0.1.0 [..]
666- [FINISHED] [..]
667- " ,
668- )
663+ [CHECKING] foo v0.1.0 ([ROOT]/foo)
664+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
665+
666+ "# ] ] )
669667 . run ( ) ;
670668
671669 fs:: remove_file ( p. root ( ) . join ( "Cargo.lock" ) ) . unwrap ( ) ;
@@ -675,12 +673,11 @@ fn index_cache_rebuild() {
675673 . with_process_builder ( tc_process ( "cargo" , "1.48.0" ) )
676674 . arg ( "tree" )
677675 . cwd ( p. root ( ) )
678- . with_stdout (
679- "\
680- foo v0.1.0 [..]
676+ . with_stdout_data ( str![ [ r#"
677+ foo v0.1.0 ([ROOT]/foo)
681678└── bar v1.0.0
682- " ,
683- )
679+
680+ "# ] ] )
684681 . run ( ) ;
685682}
686683
@@ -714,33 +711,31 @@ fn avoids_split_debuginfo_collision() {
714711 . arg ( "build" )
715712 . env ( "CARGO_INCREMENTAL" , "1" )
716713 . cwd ( p. root ( ) )
717- . with_stderr (
718- "\
719- [COMPILING] foo v0.1.0 [..]
720- [FINISHED] [..]
721- " ,
722- )
714+ . with_stderr_data ( str![ [ r#"
715+ [COMPILING] foo v0.1.0 ([ROOT]/foo)
716+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
717+
718+ "# ] ] )
723719 . run ( ) ;
724720
725721 p. cargo ( "build" )
726722 . env ( "CARGO_INCREMENTAL" , "1" )
727- . with_stderr (
728- " \
729- [COMPILING] foo v0.1.0 [..]
730- [FINISHED] [..]
731- " ,
732- )
723+ . with_stderr_data ( str! [ [ r#"
724+ [WARNING] no edition set: defaulting to the 2015 edition while the latest is [..]
725+ [COMPILING] foo v0.1.0 ([ROOT]/foo)
726+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
727+
728+ "# ] ] )
733729 . run ( ) ;
734730
735731 execs ( )
736732 . with_process_builder ( tc_process ( "cargo" , "stable" ) )
737733 . arg ( "build" )
738734 . env ( "CARGO_INCREMENTAL" , "1" )
739735 . cwd ( p. root ( ) )
740- . with_stderr (
741- "\
742- [FINISHED] [..]
743- " ,
744- )
736+ . with_stderr_data ( str![ [ r#"
737+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
738+
739+ "# ] ] )
745740 . run ( ) ;
746741}
0 commit comments