()
| 222 | |
| 223 | #[test] |
| 224 | fn test_read_or_recover_poisoned() { |
| 225 | let lock = std::sync::RwLock::new(42); |
| 226 | // Poison the lock by panicking while holding a write guard |
| 227 | let _ = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { |
| 228 | let _guard = lock.write().unwrap(); |
| 229 | panic!("intentional poison"); |
| 230 | })); |
| 231 | // Should recover without panicking |
| 232 | let guard = read_or_recover(&lock); |
| 233 | assert_eq!(*guard, 42); |
| 234 | } |
| 235 | |
| 236 | #[test] |
| 237 | fn test_write_or_recover_poisoned() { |
nothing calls this directly
no test coverage detected