MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / open_array_rejects_different_hash

Function open_array_rejects_different_hash

nodedb/src/engine/array/engine.rs:250–260  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

248
249 #[test]
250 fn open_array_rejects_different_hash() {
251 use tempfile::TempDir;
252 let dir = TempDir::new().unwrap();
253 let mut e = ArrayEngine::new(ArrayEngineConfig::new(dir.path().to_path_buf())).unwrap();
254 e.open_array(aid(), schema(), 0xC0FFEE).unwrap();
255 let err = e.open_array(aid(), schema(), 0xDEADBEEF).unwrap_err();
256 match err {
257 ArrayEngineError::SchemaMismatch { name } => assert_eq!(name, "g"),
258 other => panic!("expected SchemaMismatch, got {other:?}"),
259 }
260 }
261
262 #[test]
263 fn reopen_loads_manifest_and_segments() {

Callers

nothing calls this directly

Calls 4

open_arrayMethod · 0.80
aidFunction · 0.70
schemaFunction · 0.70
pathMethod · 0.45

Tested by

no test coverage detected