diff options
author | Aleksey Kladov <[email protected]> | 2018-08-17 14:04:34 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-17 14:04:34 +0100 |
commit | 41570f60bf268c97223a864b8aa11a339929f55a (patch) | |
tree | 1eabe16612f975a0e6bfeede79dcfea98d2b3aa4 /crates/assert_eq_text/src | |
parent | 081c16c77642a5c86ed72c5fbd11deccc2edd5d5 (diff) |
extend module resolve to mod.rs
Diffstat (limited to 'crates/assert_eq_text/src')
-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 | } | ||