Skip to content

Commit 12fe500

Browse files
committed
panic ui test: Add a test for panic::always_abort
Our existing tests are only on Unix. We want a general one too. Signed-off-by: Ian Jackson <[email protected]>
1 parent 19429ce commit 12fe500

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/test/ui/panics/abort-on-panic.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,17 @@ fn testrust() {
4343
should_have_aborted();
4444
}
4545

46+
fn test_always_abort() {
47+
panic::always_abort();
48+
let _ = panic::catch_unwind(|| { panic!(); });
49+
should_have_aborted();
50+
}
51+
4652
fn main() {
4753
let tests: &[(_, fn())] = &[
4854
("test", test),
4955
("testrust", testrust),
56+
("test_always_abort", test_always_abort),
5057
];
5158

5259
let args: Vec<String> = env::args().collect();

0 commit comments

Comments
 (0)