()
| 803 | |
| 804 | #[test] |
| 805 | fn io_error_preserves_source_chain() { |
| 806 | let original = std::io::Error::new(std::io::ErrorKind::PermissionDenied, "access denied"); |
| 807 | let err: PristineError = original.into(); |
| 808 | |
| 809 | // The source chain should be accessible for logging/debugging. |
| 810 | let source = err.source().expect("Io variant should expose source"); |
| 811 | assert!(source.to_string().contains("access denied")); |
| 812 | } |
| 813 | |
| 814 | #[test] |
| 815 | fn custom_variants_have_no_source() { |