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

Function test_negotiation_savings_pct

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

Source from the content-addressed store, hash-verified

381
382#[test]
383fn test_negotiation_savings_pct() {
384 let manifest = ChunkManifest::new(vec![
385 ChunkManifestEntry::new(0, [0xAA; 32], 50, 100),
386 ChunkManifestEntry::new(1, [0xBB; 32], 50, 100),
387 ]);
388
389 // Have one of two equal-size chunks → 50% savings
390 let have = vec![[0xAA; 32]];
391 let result = ChunkNegotiation::compute(&manifest, &have);
392 assert!((result.savings_pct() - 50.0).abs() < f64::EPSILON);
393}
394
395#[test]
396fn test_negotiation_savings_pct_zero() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected