From 7b5afed4e8285dba73474bda6f5920c7d97646ac Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 8 Mar 2022 20:42:46 -0800 Subject: [PATCH] Add test of assert_eq on strings --- pretty_assertions/tests/macros.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pretty_assertions/tests/macros.rs b/pretty_assertions/tests/macros.rs index 81e0331..dca09fe 100644 --- a/pretty_assertions/tests/macros.rs +++ b/pretty_assertions/tests/macros.rs @@ -161,6 +161,18 @@ mod assert_eq { fn fails_custom_trailing_comma() { ::pretty_assertions::assert_eq!(666, 999, "custom panic message",); } + + #[test] + #[should_panic(expected = r#"assertion failed: `(left == right)` + +Diff < left / right > : +<"foo\nbar" +>"foo\nbaz" + +"#)] + fn fails_str() { + ::pretty_assertions::assert_eq!("foo\nbar", "foo\nbaz"); + } } mod assert_ne {