aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-13 15:21:23 +0000
committerAleksey Kladov <[email protected]>2019-01-13 15:21:23 +0000
commit884ce4a4207ca68a5299b3a2e4e33b8f1f158001 (patch)
treeed8a3c14e19a67426c9b08cebb8e34ae91c8f8ab /crates/test_utils
parentc46e0300e6cebf78c78c28ca91e45b57e4e40954 (diff)
fix indent caclulation
Diffstat (limited to 'crates/test_utils')
-rw-r--r--crates/test_utils/src/lib.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs
index 012b1d0b4..9b1c9c9a0 100644
--- a/crates/test_utils/src/lib.rs
+++ b/crates/test_utils/src/lib.rs
@@ -12,18 +12,18 @@ pub const CURSOR_MARKER: &str = "<|>";
12 12
13#[macro_export] 13#[macro_export]
14macro_rules! assert_eq_text { 14macro_rules! assert_eq_text {
15 ($expected:expr, $actual:expr) => { 15 ($left:expr, $right:expr) => {
16 assert_eq_text!($expected, $actual,) 16 assert_eq_text!($left, $right,)
17 }; 17 };
18 ($expected:expr, $actual:expr, $($tt:tt)*) => {{ 18 ($left:expr, $right:expr, $($tt:tt)*) => {{
19 let expected = $expected; 19 let left = $left;
20 let actual = $actual; 20 let right = $right;
21 if expected != actual { 21 if left != right {
22 if expected.trim() == actual.trim() { 22 if left.trim() == right.trim() {
23 eprintln!("Expected:\n{:?}\n\nActual:\n{:?}\n\nWhitespace difference\n", expected, actual); 23 eprintln!("Left:\n{:?}\n\nRight:\n{:?}\n\nWhitespace difference\n", left, right);
24 } else { 24 } else {
25 let changeset = $crate::__Changeset::new(actual, expected, "\n"); 25 let changeset = $crate::__Changeset::new(right, left, "\n");
26 eprintln!("Expected:\n{}\n\nActual:\n{}\n\nDiff:\n{}\n", expected, actual, changeset); 26 eprintln!("Left:\n{}\n\nRight:\n{}\n\nDiff:\n{}\n", left, right, changeset);
27 } 27 }
28 eprintln!($($tt)*); 28 eprintln!($($tt)*);
29 panic!("text differs"); 29 panic!("text differs");