use super::{FaultKind, SourceFault, WatchError};
#[test]
fn neutral_error_surface_stands_alone_without_fs() {
let fault = SourceFault::new(FaultKind::NotFound)
.with_source(std::io::Error::from(std::io::ErrorKind::NotFound));
assert!(fault.kind().is_not_found());
assert!(
fault.downcast_ref::<std::io::Error>().is_some(),
"the concrete source error survives in the box"
);
let err = WatchError::source(fault);
assert!(err.is_source());
let carried = err.fault().expect("a Source error carries its fault");
assert!(carried.kind().is_not_found());
assert!(
matches!(WatchError::Closed, WatchError::Closed),
"the native lifecycle variant matches directly"
);
assert!(WatchError::Closed.is_closed());
assert!(WatchError::Closed.fault().is_none());
}