diff options
author | Aleksey Kladov <[email protected]> | 2018-08-12 16:50:16 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-12 16:50:16 +0100 |
commit | 66be735aa98c32fb062d1c756fa9303ff2d13002 (patch) | |
tree | d679bef9b4005f969cfa5a369c6804195de6c779 /crates/assert_eq_text/src | |
parent | 56aa6e20e0279c69e0130905573b1607056cfaf9 (diff) |
flip comma
Diffstat (limited to 'crates/assert_eq_text/src')
-rw-r--r-- | crates/assert_eq_text/src/lib.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/assert_eq_text/src/lib.rs b/crates/assert_eq_text/src/lib.rs new file mode 100644 index 000000000..ed942d81a --- /dev/null +++ b/crates/assert_eq_text/src/lib.rs | |||
@@ -0,0 +1,25 @@ | |||
1 | extern crate difference; | ||
2 | pub use self::difference::Changeset as __Changeset; | ||
3 | |||
4 | #[macro_export] | ||
5 | macro_rules! assert_eq_text { | ||
6 | ($expected:expr, $actual:expr) => {{ | ||
7 | let expected = $expected; | ||
8 | let actual = $actual; | ||
9 | if expected != actual { | ||
10 | let changeset = $crate::__Changeset::new(actual, expected, "\n"); | ||
11 | println!("Expected:\n{}\n\nActual:\n{}\nDiff:{}\n", expected, actual, changeset); | ||
12 | panic!("text differs"); | ||
13 | } | ||
14 | }}; | ||
15 | ($expected:expr, $actual:expr, $($tt:tt)*) => {{ | ||
16 | let expected = $expected; | ||
17 | let actual = $actual; | ||
18 | if expected != actual { | ||
19 | let changeset = $crate::__Changeset::new(actual, expected, "\n"); | ||
20 | println!("Expected:\n{}\n\nActual:\n{}\n\nDiff:\n{}\n", expected, actual, changeset); | ||
21 | println!($($tt)*); | ||
22 | panic!("text differs"); | ||
23 | } | ||
24 | }}; | ||
25 | } | ||