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

Function test_negotiation_no_overlap

atomic-remote/src/streaming/tests.rs:324–340  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

322
323#[test]
324fn test_negotiation_no_overlap() {
325 let manifest = ChunkManifest::new(vec![
326 ChunkManifestEntry::new(0, [0xAA; 32], 32000, 65536),
327 ChunkManifestEntry::new(1, [0xBB; 32], 28000, 65536),
328 ]);
329
330 let have: Vec<[u8; 32]> = vec![]; // nothing
331 let result = ChunkNegotiation::compute(&manifest, &have);
332
333 assert_eq!(result.needed.len(), 2);
334 assert_eq!(result.already_have, 0);
335 assert_eq!(result.bytes_saved, 0);
336 assert_eq!(result.bytes_needed, 60000);
337 assert!(result.is_full_transfer());
338 assert!(!result.is_complete());
339 assert_eq!(result.total_chunks, 2);
340}
341
342#[test]
343fn test_negotiation_full_overlap() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected