Skip to content

Commit c7182e7

Browse files
committed
test: relax assertions of panic handler message format
1 parent ed9845f commit c7182e7

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

tests/testsuite/bench.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,8 @@ fn cargo_bench_failing_test() {
313313
[FINISHED] bench [optimized] target(s) in [..]
314314
[RUNNING] [..] (target/release/deps/foo-[..][EXE])",
315315
)
316-
.with_stdout_contains(
317-
"[..]thread '[..]' panicked at 'assertion failed: `(left == right)`[..]",
318-
)
316+
.with_stdout_contains("[..]thread '[..]' panicked at[..]")
317+
.with_stdout_contains("[..]assertion failed[..]")
319318
.with_stdout_contains("[..]left: `\"hello\"`[..]")
320319
.with_stdout_contains("[..]right: `\"nope\"`[..]")
321320
.with_stdout_contains("[..]src/main.rs:15[..]")

tests/testsuite/install.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,8 @@ fn reports_unsuccessful_subcommand_result() {
12691269
.run();
12701270
cargo_process("fail")
12711271
.with_status(101)
1272-
.with_stderr_contains("thread '[..]' panicked at 'explicit panic', [..]")
1272+
.with_stderr_contains("thread '[..]' panicked at [..]src/main.rs:1:[..]")
1273+
.with_stderr_contains("[..]explicit panic[..]")
12731274
.run();
12741275
}
12751276

tests/testsuite/test.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,9 @@ test test_hello ... FAILED
387387
failures:
388388
389389
---- test_hello stdout ----
390-
[..]thread '[..]' panicked at 'assertion failed:[..]",
390+
[..]thread '[..]' panicked at [..]",
391391
)
392+
.with_stdout_contains("[..]assertion failed[..]")
392393
.with_stdout_contains("[..]`(left == right)`[..]")
393394
.with_stdout_contains("[..]left: `\"hello\"`,[..]")
394395
.with_stdout_contains("[..]right: `\"nope\"`[..]")
@@ -437,10 +438,10 @@ test test_hello ... FAILED
437438
failures:
438439
439440
---- test_hello stdout ----
440-
[..]thread '[..]' panicked at 'assertion failed: false', \
441-
tests/footest.rs:1[..]
441+
[..]thread '[..]' panicked at [..]tests/footest.rs:1:[..]
442442
",
443443
)
444+
.with_stdout_contains("[..]assertion failed[..]")
444445
.with_stdout_contains(
445446
"\
446447
failures:
@@ -473,10 +474,10 @@ test test_hello ... FAILED
473474
failures:
474475
475476
---- test_hello stdout ----
476-
[..]thread '[..]' panicked at 'assertion failed: false', \
477-
src/lib.rs:1[..]
477+
[..]thread '[..]' panicked at [..]src/lib.rs:1:[..]
478478
",
479479
)
480+
.with_stdout_contains("[..]assertion failed[..]")
480481
.with_stdout_contains(
481482
"\
482483
failures:

0 commit comments

Comments
 (0)