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

Function test_realistic_clone_scenario

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

Source from the content-addressed store, hash-verified

774
775#[test]
776fn test_realistic_clone_scenario() {
777 // Scenario: Fresh clone — client has nothing.
778 let entries: Vec<ChunkManifestEntry> = (0..50)
779 .map(|i| {
780 let mut hash = [0u8; 32];
781 hash[0] = i;
782 ChunkManifestEntry::new(i as u32, hash, 30000, 65536)
783 })
784 .collect();
785
786 let manifest = ChunkManifest::new(entries);
787
788 // Client has nothing
789 let negotiation = ChunkNegotiation::compute(&manifest, &[]);
790
791 assert!(negotiation.is_full_transfer());
792 assert_eq!(negotiation.needed.len(), 50);
793 assert_eq!(negotiation.bytes_needed, 50 * 30000);
794 assert!((negotiation.savings_pct() - 0.0).abs() < f64::EPSILON);
795}

Callers

nothing calls this directly

Calls 1

collectMethod · 0.45

Tested by

no test coverage detected