Closed
Description
When running this test (playground):
#[test]
#[should_panic(expected = "foo\r\n")]
fn panic_test() {
panic!("foo\n");
}
the output is
running 1 test
test panic_test ... FAILED
failures:
---- panic_test stdout ----
thread 'panic_test' panicked at 'foo
', src/lib.rs:4:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
note: panic did not include expected string 'foo
'
failures:
panic_test
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
which makes it hard to spot the difference in whitespace characters.
Would it be possible to change this to e.g.:
running 1 test
test panic_test ... FAILED
failures:
---- panic_test stdout ----
thread 'panic_test' panicked at 'foo
', src/lib.rs:4:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
note: panic did not include expected string 'foo
'
Panic message: "foo\n"
Expected string: "foo\r\n"
failures:
panic_test
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
This would improve the usability when running into these kinds of test failures and also make it more consistent with assert_eq
which outputs both the left and the right value too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment