@@ -108,7 +108,10 @@ impl CompletedProcess {
108
108
/// Checks that trimmed `stdout` matches trimmed `content`.
109
109
#[ track_caller]
110
110
pub fn assert_stdout_equals < S : AsRef < str > > ( self , content : S ) -> Self {
111
- assert_eq ! ( self . stdout_utf8( ) . trim( ) , content. as_ref( ) . trim( ) ) ;
111
+ assert_eq ! (
112
+ self . stdout_utf8( ) . trim( ) , content. as_ref( ) . trim( )
113
+ "{}" , format!( "The stdout \" {}\" did not equal the string \" {}\" " , self . stdout_utf8( ) . as_str( ) , content. as_ref( ) . trim( ) )
114
+ ) ;
112
115
self
113
116
}
114
117
@@ -121,18 +124,28 @@ impl CompletedProcess {
121
124
/// Checks that trimmed `stderr` matches trimmed `content`.
122
125
#[ track_caller]
123
126
pub fn assert_stderr_equals < S : AsRef < str > > ( self , content : S ) -> Self {
124
- assert_eq ! ( self . stderr_utf8( ) . trim( ) , content. as_ref( ) . trim( ) ) ;
127
+ assert_eq ! (
128
+ self . stderr_utf8( ) . trim( ) ,
129
+ content. as_ref( ) . trim( ) ,
130
+ "{}" ,
131
+ format!(
132
+ "The stderr \" {}\" did not equal the string \" {}\" " ,
133
+ self . stderr_utf8( ) . as_str( ) ,
134
+ content. as_ref( ) . trim( )
135
+ )
136
+ ) ;
125
137
self
126
138
}
127
139
128
140
#[ track_caller]
129
141
pub fn assert_stderr_contains < S : AsRef < str > > ( self , needle : S ) -> Self {
130
142
assert ! (
131
143
self . stderr_utf8( ) . contains( needle. as_ref( ) ) ,
144
+ "{}" ,
132
145
format!(
133
- "The stderr {} did not contain the string {} " ,
146
+ "The stderr \" {} \" did not contain the string \" {} \" " ,
134
147
self . stderr_utf8( ) . as_str( ) ,
135
- needle. as_ref( ) ,
148
+ needle. as_ref( )
136
149
)
137
150
) ;
138
151
self
0 commit comments