1
1
//! Tests for the `cargo verify-project` command.
2
2
3
- #![ allow( deprecated) ]
4
-
5
- use cargo_test_support:: { basic_bin_manifest, main_file, project} ;
6
-
7
- fn verify_project_success_output ( ) -> String {
8
- r#"{"success":"true"}"# . into ( )
9
- }
3
+ use cargo_test_support:: { basic_bin_manifest, main_file, project, str} ;
10
4
11
5
#[ cargo_test]
12
6
fn cargo_verify_project_path_to_cargo_toml_relative ( ) {
@@ -17,7 +11,10 @@ fn cargo_verify_project_path_to_cargo_toml_relative() {
17
11
18
12
p. cargo ( "verify-project --manifest-path foo/Cargo.toml" )
19
13
. cwd ( p. root ( ) . parent ( ) . unwrap ( ) )
20
- . with_stdout ( verify_project_success_output ( ) )
14
+ . with_stdout_data ( str![ [ r#"
15
+ {"success":"true"}
16
+
17
+ "# ] ] )
21
18
. run ( ) ;
22
19
}
23
20
@@ -31,7 +28,10 @@ fn cargo_verify_project_path_to_cargo_toml_absolute() {
31
28
p. cargo ( "verify-project --manifest-path" )
32
29
. arg ( p. root ( ) . join ( "Cargo.toml" ) )
33
30
. cwd ( p. root ( ) . parent ( ) . unwrap ( ) )
34
- . with_stdout ( verify_project_success_output ( ) )
31
+ . with_stdout_data ( str![ [ r#"
32
+ {"success":"true"}
33
+
34
+ "# ] ] )
35
35
. run ( ) ;
36
36
}
37
37
@@ -43,7 +43,10 @@ fn cargo_verify_project_cwd() {
43
43
. build ( ) ;
44
44
45
45
p. cargo ( "verify-project" )
46
- . with_stdout ( verify_project_success_output ( ) )
46
+ . with_stdout_data ( str![ [ r#"
47
+ {"success":"true"}
48
+
49
+ "# ] ] )
47
50
. run ( ) ;
48
51
}
49
52
@@ -65,11 +68,17 @@ fn cargo_verify_project_honours_unstable_features() {
65
68
66
69
p. cargo ( "verify-project" )
67
70
. masquerade_as_nightly_cargo ( & [ "test-dummy-unstable" ] )
68
- . with_stdout ( verify_project_success_output ( ) )
71
+ . with_stdout_data ( str![ [ r#"
72
+ {"success":"true"}
73
+
74
+ "# ] ] )
69
75
. run ( ) ;
70
76
71
77
p. cargo ( "verify-project" )
72
78
. with_status ( 1 )
73
- . with_json ( r#"{"invalid":"failed to parse manifest at `[CWD]/Cargo.toml`"}"# )
79
+ . with_stdout_data ( str![ [ r#"
80
+ {"invalid":"failed to parse manifest at `[..]`"}
81
+
82
+ "# ] ] )
74
83
. run ( ) ;
75
84
}
0 commit comments