aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils
diff options
context:
space:
mode:
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");