allow(test-attribute)
()
| 25 | |
| 26 | #[tokio::test] // allow(test-attribute) |
| 27 | async fn catch_panic_async() { |
| 28 | let old_hook = panic::take_hook(); |
| 29 | defer! { |
| 30 | panic::set_hook(old_hook); |
| 31 | } |
| 32 | |
| 33 | install_enhanced_handler(); |
| 34 | |
| 35 | let result = async { |
| 36 | panic!("panicked"); |
| 37 | } |
| 38 | .ore_catch_unwind() |
| 39 | .await |
| 40 | .unwrap_err() |
| 41 | .downcast::<&str>() |
| 42 | .unwrap(); |
| 43 | |
| 44 | assert_eq!(*result, "panicked"); |
| 45 | } |
nothing calls this directly
no test coverage detected