()
| 235 | |
| 236 | #[test] |
| 237 | fn test_write_or_recover_poisoned() { |
| 238 | let lock = std::sync::RwLock::new(42); |
| 239 | let _ = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { |
| 240 | let _guard = lock.write().unwrap(); |
| 241 | panic!("intentional poison"); |
| 242 | })); |
| 243 | let mut guard = write_or_recover(&lock); |
| 244 | *guard = 100; |
| 245 | assert_eq!(*guard, 100); |
| 246 | } |
| 247 | } |
nothing calls this directly
no test coverage detected