]> git.lizzy.rs Git - rust.git/commitdiff
test more panics
authorRalf Jung <post@ralfj.de>
Thu, 28 Nov 2019 18:17:43 +0000 (19:17 +0100)
committerRalf Jung <post@ralfj.de>
Sun, 1 Dec 2019 10:04:32 +0000 (11:04 +0100)
tests/run-pass/catch_panic.rs
tests/run-pass/catch_panic.stderr

index c504956db35aaec0dabb2ce8c2d4ad8e547098ad..88fc35067d012acf05d7bfb3d6585162440a2fc1 100644 (file)
@@ -44,14 +44,14 @@ fn main() {
         prev(panic_info)
     }));
 
-    test(|_old_val| panic!("Hello from panic: std"));
-    test(|old_val| panic!(format!("Hello from panic: {:?}", old_val)));
-    test(|old_val| panic!("Hello from panic: {:?}", old_val));
-    test(|_old_val| panic!(1337));
-    // FIXME https://github.com/rust-lang/miri/issues/1071
-    //test(|_old_val| core::panic!("Hello from panic: core"));
-    //test(|old_val| core::panic!(&format!("Hello from panic: {:?}", old_val)));
-    //test(|old_val| core::panic!("Hello from panic: {:?}", old_val));
+    test(|_old_val| std::panic!("Hello from panic: std"));
+    test(|old_val| std::panic!(format!("Hello from panic: {:?}", old_val)));
+    test(|old_val| std::panic!("Hello from panic: {:?}", old_val));
+    test(|_old_val| std::panic!(1337));
+
+    test(|_old_val| core::panic!("Hello from panic: core"));
+    test(|old_val| core::panic!(&format!("Hello from panic: {:?}", old_val)));
+    test(|old_val| core::panic!("Hello from panic: {:?}", old_val));
 
     // Cleanup: reset to default hook.
     drop(std::panic::take_hook());
index 6d905da7febe69452c4f02c55fcfe33131799c59..51814c7cde6e9d0484fdf81b05f7fc9813813feb 100644 (file)
@@ -6,4 +6,10 @@ thread 'main' panicked at 'Hello from panic: 2', $DIR/catch_panic.rs:49:20
 Caught panic message (String): Hello from panic: 2
 thread 'main' panicked at 'Box<Any>', $DIR/catch_panic.rs:50:21
 Failed get caught panic message.
+thread 'main' panicked at 'Hello from panic: core', tests/run-pass/catch_panic.rs:52:21
+Caught panic message (String): Hello from panic: core
+thread 'main' panicked at 'Hello from panic: 5', tests/run-pass/catch_panic.rs:53:20
+Caught panic message (String): Hello from panic: 5
+thread 'main' panicked at 'Hello from panic: 6', tests/run-pass/catch_panic.rs:54:20
+Caught panic message (String): Hello from panic: 6
 Success!