MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_error_source

Function test_error_source

atomic-core/src/crdt/apply/error.rs:1052–1065  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

storageFunction · 0.85

Tested by

no test coverage detected