From 12fe50010da70abfca84ae9c0d6e798e987fa882 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 22 Apr 2021 14:22:42 +0100 Subject: [PATCH] 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 --- src/test/ui/panics/abort-on-panic.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/ui/panics/abort-on-panic.rs b/src/test/ui/panics/abort-on-panic.rs index 7cf60ae9602..c02552be519 100644 --- a/src/test/ui/panics/abort-on-panic.rs +++ b/src/test/ui/panics/abort-on-panic.rs @@ -43,10 +43,17 @@ fn testrust() { should_have_aborted(); } +fn test_always_abort() { + panic::always_abort(); + let _ = panic::catch_unwind(|| { panic!(); }); + should_have_aborted(); +} + fn main() { let tests: &[(_, fn())] = &[ ("test", test), ("testrust", testrust), + ("test_always_abort", test_always_abort), ]; let args: Vec = env::args().collect();