Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4f5edfd

Browse files
committedApr 8, 2025··
Add directive --nocapture
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
1 parent cf0b21d commit 4f5edfd

3 files changed

+14
-7
lines changed
 

‎tests/ui/test-attrs/test-should-panic-failed-show-span.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ no-prefer-dynamic
22
//@ compile-flags: --test
3-
//@ run-flags: --test-threads=1
3+
//@ run-flags: --test-threads=1 --nocapture
44
//@ run-fail
55
//@ check-run-results
66
//@ exec-env:RUST_BACKTRACE=0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
thread 'should_panic_with_any_message' panicked at $DIR/test-should-panic-failed-show-span.rs:13:5:
3+
Panic!
4+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
5+
6+
thread 'should_panic_with_message' panicked at $DIR/test-should-panic-failed-show-span.rs:19:5:
7+
message
8+
9+
thread 'should_panic_with_substring_panics_with_incorrect_string' panicked at $DIR/test-should-panic-failed-show-span.rs:37:5:
10+
ZOMGWTFBBQ
11+
12+
thread 'should_panic_with_substring_panics_with_non_string_value' panicked at $DIR/test-should-panic-failed-show-span.rs:43:5:
13+
Box<dyn Any>

‎tests/ui/test-attrs/test-should-panic-failed-show-span.run.stdout

-6
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@ note: test did not panic as expected at $DIR/test-should-panic-failed-show-span.
1414
---- should_panic_with_message_does_not_panic stdout ----
1515
note: test did not panic as expected at $DIR/test-should-panic-failed-show-span.rs:30:4
1616
---- should_panic_with_substring_panics_with_incorrect_string stdout ----
17-
18-
thread 'should_panic_with_substring_panics_with_incorrect_string' panicked at $DIR/test-should-panic-failed-show-span.rs:37:5:
19-
ZOMGWTFBBQ
2017
note: panic did not contain expected string
2118
panic message: `"ZOMGWTFBBQ"`,
2219
expected substring: `"message"`
2320
---- should_panic_with_substring_panics_with_non_string_value stdout ----
24-
25-
thread 'should_panic_with_substring_panics_with_non_string_value' panicked at $DIR/test-should-panic-failed-show-span.rs:43:5:
26-
Box<dyn Any>
2721
note: expected panic with string value,
2822
found non-string value: `TypeId(0x56ced5e4a15bd89050bb9674fa2df013)`
2923
expected substring: `"message"`

0 commit comments

Comments
 (0)
Please sign in to comment.