| 1050 | |
| 1051 | #[test] |
| 1052 | fn test_error_source() { |
| 1053 | let pristine_err = PristineError::ViewNotFound { |
| 1054 | name: "test".to_string(), |
| 1055 | }; |
| 1056 | let err = ApplyError::storage(pristine_err, "testing"); |
| 1057 | |
| 1058 | // Storage error should have a source |
| 1059 | assert!(Error::source(&err).is_some()); |
| 1060 | |
| 1061 | // Other errors should not have a source |
| 1062 | let trunk_id = TrunkId::new(NodeId::new(1), 0); |
| 1063 | let err2 = ApplyError::trunk_not_found(trunk_id); |
| 1064 | assert!(Error::source(&err2).is_none()); |
| 1065 | } |
| 1066 | |
| 1067 | #[test] |
| 1068 | fn test_from_pristine_error() { |