@@ -86,13 +86,19 @@ fn no_warning_on_bin_failure() {
86
86
. cargo ( "build" )
87
87
. with_status ( 101 )
88
88
. with_stdout_does_not_contain ( "hidden stdout" )
89
- . with_stderr_does_not_contain ( "hidden stderr" )
90
- . with_stderr_does_not_contain ( & format ! ( "[WARNING] {}" , WARNING1 ) )
91
- . with_stderr_does_not_contain ( & format ! ( "[WARNING] {}" , WARNING2 ) )
92
- . with_stderr_contains ( "[UPDATING] `[..]` index" )
93
- . with_stderr_contains ( "[DOWNLOADED] bar v0.0.1 ([..])" )
94
- . with_stderr_contains ( "[COMPILING] bar v0.0.1" )
95
- . with_stderr_contains ( "[COMPILING] foo v0.0.1 ([..])" )
89
+ . with_stderr_data ( str![ [ r#"
90
+ [UPDATING] `dummy-registry` index
91
+ [LOCKING] 2 packages to latest compatible versions
92
+ [DOWNLOADING] crates ...
93
+ [DOWNLOADED] bar v0.0.1 (registry `dummy-registry`)
94
+ [COMPILING] bar v0.0.1
95
+ [COMPILING] foo v0.0.1 ([ROOT]/foo)
96
+ error[E0425]: cannot find function `hi` in this scope
97
+ ...
98
+ For more information about this error, try `rustc --explain E0425`.
99
+ [ERROR] could not compile `foo` (bin "foo") due to 1 previous error
100
+
101
+ "# ] ] )
96
102
. run ( ) ;
97
103
}
98
104
@@ -105,12 +111,21 @@ fn warning_on_lib_failure() {
105
111
. cargo ( "build" )
106
112
. with_status ( 101 )
107
113
. with_stdout_does_not_contain ( "hidden stdout" )
108
- . with_stderr_does_not_contain ( "hidden stderr" )
109
- . with_stderr_does_not_contain ( "[COMPILING] foo v0.0.1 ([..])" )
110
- . with_stderr_contains ( "[UPDATING] `[..]` index" )
111
- . with_stderr_contains ( "[DOWNLOADED] bar v0.0.1 ([..])" )
112
- . with_stderr_contains ( "[COMPILING] bar v0.0.1" )
113
- . with_stderr_contains ( & format ! ( "[WARNING] [email protected] : {}" , WARNING1 ) )
114
- . with_stderr_contains ( & format ! ( "[WARNING] [email protected] : {}" , WARNING2 ) )
114
+ . with_stderr_data ( str![ [ r#"
115
+ [UPDATING] `dummy-registry` index
116
+ [LOCKING] 2 packages to latest compatible versions
117
+ [DOWNLOADING] crates ...
118
+ [DOWNLOADED] bar v0.0.1 (registry `dummy-registry`)
119
+ [COMPILING] bar v0.0.1
120
+ error[E0425]: cannot find function `err` in this scope
121
+ ...
122
+ The following warnings were emitted during compilation:
123
+
124
+ [WARNING] [email protected] : Hello! I'm a warning. :)
125
+ [WARNING] [email protected] : And one more!
126
+
127
+ [ERROR] could not compile `bar` (lib) due to 1 previous error
128
+
129
+ "# ] ] )
115
130
. run ( ) ;
116
131
}
0 commit comments