Skip to content

Commit 3f0b219

Browse files
committed
Add the actual display string to the explain_match output.
1 parent 1862fe3 commit 3f0b219

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

googletest/src/matchers/display_matcher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<T: Debug + Display, InnerMatcher: Matcher<ActualT = String>> Matcher
4444
}
4545

4646
fn explain_match(&self, actual: &T) -> Description {
47-
format!("which displays as a string {}", self.inner.explain_match(&format!("{actual}")))
47+
format!("which displays as {:?} {}", actual.to_string(), self.inner.explain_match(&format!("{actual}")))
4848
.into()
4949
}
5050

@@ -112,7 +112,7 @@ mod tests {
112112
err(displays_as(contains_substring(indoc!(
113113
"
114114
Actual: \"123\\n234\",
115-
which displays as a string which isn't equal to \"123\\n345\"
115+
which displays as \"123\\n234\" which isn't equal to \"123\\n345\"
116116
Difference(-actual / +expected):
117117
123
118118
-234

0 commit comments

Comments
 (0)