Skip to content

Commit

Permalink
test: relax assertions of panic handler message format
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Aug 7, 2023
1 parent ed9845f commit c7182e7
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 @@ -1269,7 +1269,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 c7182e7

Please sign in to comment.