Skip to content

Commit

Permalink
Auto merge of #12413 - weihanglo:tweak-panic-msg, r=ehuss
Browse files Browse the repository at this point in the history
test: relax assertions of panic handler message format
  • Loading branch information
bors committed Jul 29, 2023
2 parents c863660 + b9e70ec commit 1680ab5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 2 additions & 3 deletions tests/testsuite/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,8 @@ fn cargo_bench_failing_test() {
[FINISHED] bench [optimized] target(s) in [..]
[RUNNING] [..] (target/release/deps/foo-[..][EXE])",
)
.with_stdout_contains(
"[..]thread '[..]' panicked at 'assertion failed: `(left == right)`[..]",
)
.with_stdout_contains("[..]thread '[..]' panicked at[..]")
.with_stdout_contains("[..]assertion failed[..]")
.with_stdout_contains("[..]left: `\"hello\"`[..]")
.with_stdout_contains("[..]right: `\"nope\"`[..]")
.with_stdout_contains("[..]src/main.rs:15[..]")
Expand Down
3 changes: 2 additions & 1 deletion tests/testsuite/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,8 @@ fn reports_unsuccessful_subcommand_result() {
.run();
cargo_process("fail")
.with_status(101)
.with_stderr_contains("thread '[..]' panicked at 'explicit panic', [..]")
.with_stderr_contains("thread '[..]' panicked at [..]src/main.rs:1:[..]")
.with_stderr_contains("[..]explicit panic[..]")
.run();
}

Expand Down
11 changes: 6 additions & 5 deletions tests/testsuite/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,9 @@ test test_hello ... FAILED
failures:
---- test_hello stdout ----
[..]thread '[..]' panicked at 'assertion failed:[..]",
[..]thread '[..]' panicked at [..]",
)
.with_stdout_contains("[..]assertion failed[..]")
.with_stdout_contains("[..]`(left == right)`[..]")
.with_stdout_contains("[..]left: `\"hello\"`,[..]")
.with_stdout_contains("[..]right: `\"nope\"`[..]")
Expand Down Expand Up @@ -437,10 +438,10 @@ test test_hello ... FAILED
failures:
---- test_hello stdout ----
[..]thread '[..]' panicked at 'assertion failed: false', \
tests/footest.rs:1[..]
[..]thread '[..]' panicked at [..]tests/footest.rs:1:[..]
",
)
.with_stdout_contains("[..]assertion failed[..]")
.with_stdout_contains(
"\
failures:
Expand Down Expand Up @@ -473,10 +474,10 @@ test test_hello ... FAILED
failures:
---- test_hello stdout ----
[..]thread '[..]' panicked at 'assertion failed: false', \
src/lib.rs:1[..]
[..]thread '[..]' panicked at [..]src/lib.rs:1:[..]
",
)
.with_stdout_contains("[..]assertion failed[..]")
.with_stdout_contains(
"\
failures:
Expand Down

0 comments on commit 1680ab5

Please sign in to comment.