aboutsummaryrefslogtreecommitdiff
path: root/crates/assert_eq_text/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/assert_eq_text/src/lib.rs')
-rw-r--r--crates/assert_eq_text/src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/assert_eq_text/src/lib.rs b/crates/assert_eq_text/src/lib.rs
index ed942d81a..26b9bfb38 100644
--- a/crates/assert_eq_text/src/lib.rs
+++ b/crates/assert_eq_text/src/lib.rs
@@ -1,4 +1,9 @@
1extern crate difference; 1extern crate difference;
2extern crate itertools;
3
4use std::fmt;
5use itertools::Itertools;
6
2pub use self::difference::Changeset as __Changeset; 7pub use self::difference::Changeset as __Changeset;
3 8
4#[macro_export] 9#[macro_export]
@@ -23,3 +28,9 @@ macro_rules! assert_eq_text {
23 } 28 }
24 }}; 29 }};
25} 30}
31
32pub fn assert_eq_dbg(expected: &str, actual: &impl fmt::Debug) {
33 let actual = format!("{:?}", actual);
34 let expected = expected.lines().map(|l| l.trim()).join(" ");
35 assert_eq!(expected, actual);
36}