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

Function test_negotiation_full_overlap

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

Source from the content-addressed store, hash-verified

341
342#[test]
343fn test_negotiation_full_overlap() {
344 let manifest = ChunkManifest::new(vec![
345 ChunkManifestEntry::new(0, [0xAA; 32], 32000, 65536),
346 ChunkManifestEntry::new(1, [0xBB; 32], 28000, 65536),
347 ]);
348
349 let have = vec![[0xAA; 32], [0xBB; 32]];
350 let result = ChunkNegotiation::compute(&manifest, &have);
351
352 assert!(result.needed.is_empty());
353 assert_eq!(result.already_have, 2);
354 assert_eq!(result.bytes_saved, 60000);
355 assert_eq!(result.bytes_needed, 0);
356 assert!(result.is_complete());
357 assert!(!result.is_full_transfer());
358}
359
360#[test]
361fn test_negotiation_partial_overlap() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected