Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: relax assertions of panic handler message format #12413

Merged
merged 1 commit into from
Jul 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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