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 <ijackson@chiark.greenend.org.uk>
This commit is contained in:
Ian Jackson 2021-04-22 14:22:42 +01:00
parent 19429ce132
commit 12fe50010d

View File

@ -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<String> = env::args().collect();