()
| 474 | |
| 475 | #[test] |
| 476 | fn io_error_preserves_source_chain() { |
| 477 | let original = std::io::Error::new(std::io::ErrorKind::PermissionDenied, "access denied"); |
| 478 | let err: PristineError = original.into(); |
| 479 | |
| 480 | // The source chain should be accessible for logging/debugging. |
| 481 | let source = err.source().expect("Io variant should expose source"); |
| 482 | assert!(source.to_string().contains("access denied")); |
| 483 | } |
| 484 | |
| 485 | #[test] |
| 486 | fn custom_variants_have_no_source() { |