diff options
Diffstat (limited to 'crates/assert_eq_text/src/lib.rs')
-rw-r--r-- | crates/assert_eq_text/src/lib.rs | 11 |
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 @@ | |||
1 | extern crate difference; | 1 | extern crate difference; |
2 | extern crate itertools; | ||
3 | |||
4 | use std::fmt; | ||
5 | use itertools::Itertools; | ||
6 | |||
2 | pub use self::difference::Changeset as __Changeset; | 7 | pub 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 | |||
32 | pub 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 | } | ||