1
1
//! Tests for the `cargo fetch` command.
2
2
3
- #![ allow( deprecated) ]
4
-
5
3
use cargo_test_support:: prelude:: * ;
6
4
use cargo_test_support:: registry:: Package ;
7
5
use cargo_test_support:: rustc_host;
8
- use cargo_test_support:: { basic_manifest, cross_compile, project} ;
6
+ use cargo_test_support:: { basic_manifest, cross_compile, project, str } ;
9
7
10
8
#[ cargo_test]
11
9
fn no_deps ( ) {
@@ -14,7 +12,7 @@ fn no_deps() {
14
12
. file ( "src/a.rs" , "" )
15
13
. build ( ) ;
16
14
17
- p. cargo ( "fetch" ) . with_stderr ( "" ) . run ( ) ;
15
+ p. cargo ( "fetch" ) . with_stderr_data ( "" ) . run ( ) ;
18
16
}
19
17
20
18
#[ cargo_test]
@@ -60,11 +58,16 @@ fn fetch_all_platform_dependencies_when_no_target_is_given() {
60
58
. build ( ) ;
61
59
62
60
p. cargo ( "fetch" )
63
- . with_stderr_contains ( "[DOWNLOADED] d1 v1.2.3 [..]" )
64
- . with_stderr_contains ( "[DOWNLOADED] d2 v0.1.2 [..]" )
61
+ . with_stderr_data ( str![ [ r#"
62
+ ...
63
+ [DOWNLOADED] d1 v1.2.3 (registry `dummy-registry`)
64
+ [DOWNLOADED] d2 v0.1.2 (registry `dummy-registry`)
65
+ ...
66
+ "# ] ] )
65
67
. run ( ) ;
66
68
}
67
69
70
+ #[ allow( deprecated) ]
68
71
#[ cargo_test]
69
72
fn fetch_platform_specific_dependencies ( ) {
70
73
if cross_compile:: disabled ( ) {
@@ -136,6 +139,9 @@ fn fetch_warning() {
136
139
. file ( "src/lib.rs" , "" )
137
140
. build ( ) ;
138
141
p. cargo ( "fetch" )
139
- . with_stderr ( "[WARNING] unused manifest key: package.misspelled" )
142
+ . with_stderr_data ( str![ [ r#"
143
+ [WARNING] unused manifest key: package.misspelled
144
+
145
+ "# ] ] )
140
146
. run ( ) ;
141
147
}
0 commit comments