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

Function checkpoint_roundtrip_with_buffer

nodedb-graph/src/csr/persist.rs:354–363  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

352
353 #[test]
354 fn checkpoint_roundtrip_with_buffer() {
355 let mut csr = CsrIndex::new();
356 csr.add_edge("a", "L", "b").unwrap();
357 // Don't compact — edges in buffer.
358 let bytes = csr.checkpoint_to_bytes().expect("no governor, cannot fail");
359 let restored = CsrIndex::from_checkpoint(&bytes)
360 .expect("roundtrip")
361 .unwrap();
362 assert_eq!(restored.edge_count(), 1);
363 }
364
365 #[test]
366 fn golden_header_layout() {

Callers

nothing calls this directly

Calls 3

add_edgeMethod · 0.80
expectMethod · 0.45
checkpoint_to_bytesMethod · 0.45

Tested by

no test coverage detected