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