aboutsummaryrefslogtreecommitdiff
path: root/crates/expect/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/expect/src')
-rw-r--r--crates/expect/src/lib.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/crates/expect/src/lib.rs b/crates/expect/src/lib.rs
index dc4a4223e..18f361ec2 100644
--- a/crates/expect/src/lib.rs
+++ b/crates/expect/src/lib.rs
@@ -107,22 +107,30 @@ impl Runtime {
107 rt.help_printed = true; 107 rt.help_printed = true;
108 108
109 let help = if print_help { HELP } else { "" }; 109 let help = if print_help { HELP } else { "" };
110
111 let diff = difference::Changeset::new(actual, expected, "\n");
112
110 println!( 113 println!(
111 "\n 114 "\n
112error: expect test failed{} 115\x1b[1m\x1b[91merror\x1b[97m: expect test failed\x1b[0m{}
113 --> {}:{}:{} 116 \x1b[1m\x1b[34m-->\x1b[0m {}:{}:{}
117{}
118\x1b[1mExpect\x1b[0m:
119----
114{} 120{}
115Expect: 121----
122
123\x1b[1mActual\x1b[0m:
116---- 124----
117{} 125{}
118---- 126----
119 127
120Actual: 128\x1b[1mDiff\x1b[0m:
121---- 129----
122{} 130{}
123---- 131----
124", 132",
125 updated, expect.file, expect.line, expect.column, help, expected, actual 133 updated, expect.file, expect.line, expect.column, help, expected, actual, diff
126 ); 134 );
127 // Use resume_unwind instead of panic!() to prevent a backtrace, which is unnecessary noise. 135 // Use resume_unwind instead of panic!() to prevent a backtrace, which is unnecessary noise.
128 std::panic::resume_unwind(Box::new(())); 136 std::panic::resume_unwind(Box::new(()));