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

Function assemble_rejects_missing_chunk

nodedb-array/src/sync/snapshot.rs:318–325  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

316
317 #[test]
318 fn assemble_rejects_missing_chunk() {
319 let s = snapshot(1000);
320 let (header, mut chunks) = split_into_chunks(&s, 300).unwrap();
321 // Remove chunk at index 2 to create a gap.
322 chunks.retain(|c| c.chunk_index != 2);
323 let result = assemble_chunks(&header, &mut chunks);
324 assert!(matches!(result, Err(ArrayError::SegmentCorruption { .. })));
325 }
326
327 #[test]
328 fn assemble_rejects_duplicate_chunk() {

Callers

nothing calls this directly

Calls 3

snapshotFunction · 0.85
split_into_chunksFunction · 0.85
assemble_chunksFunction · 0.85

Tested by

no test coverage detected