@@ -163,7 +163,16 @@ impl CompletedProcess {
163
163
/// Checks that trimmed `stdout` matches trimmed `content`.
164
164
#[ track_caller]
165
165
pub fn assert_stdout_equals < S : AsRef < str > > ( & self , content : S ) -> & Self {
166
- assert_eq ! ( self . stdout_utf8( ) . trim( ) , content. as_ref( ) . trim( ) ) ;
166
+ assert_eq ! (
167
+ self . stdout_utf8( ) . trim( ) ,
168
+ content. as_ref( ) . trim( ) ,
169
+ "{}" ,
170
+ format!(
171
+ "The stdout \" {}\" did not equal the string \" {}\" " ,
172
+ self . stdout_utf8( ) . as_str( ) ,
173
+ content. as_ref( ) . trim( )
174
+ )
175
+ ) ;
167
176
self
168
177
}
169
178
@@ -176,18 +185,28 @@ impl CompletedProcess {
176
185
/// Checks that trimmed `stderr` matches trimmed `content`.
177
186
#[ track_caller]
178
187
pub fn assert_stderr_equals < S : AsRef < str > > ( & self , content : S ) -> & Self {
179
- assert_eq ! ( self . stderr_utf8( ) . trim( ) , content. as_ref( ) . trim( ) ) ;
188
+ assert_eq ! (
189
+ self . stderr_utf8( ) . trim( ) ,
190
+ content. as_ref( ) . trim( ) ,
191
+ "{}" ,
192
+ format!(
193
+ "The stderr \" {}\" did not equal the string \" {}\" " ,
194
+ self . stderr_utf8( ) . as_str( ) ,
195
+ content. as_ref( ) . trim( )
196
+ )
197
+ ) ;
180
198
self
181
199
}
182
200
183
201
#[ track_caller]
184
202
pub fn assert_stderr_contains < S : AsRef < str > > ( & self , needle : S ) -> & Self {
185
203
assert ! (
186
204
self . stderr_utf8( ) . contains( needle. as_ref( ) ) ,
205
+ "{}" ,
187
206
format!(
188
- "The stderr {} did not contain the string {} " ,
207
+ "The stderr \" {} \" did not contain the string \" {} \" " ,
189
208
self . stderr_utf8( ) . as_str( ) ,
190
- needle. as_ref( ) ,
209
+ needle. as_ref( )
191
210
)
192
211
) ;
193
212
self
0 commit comments