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

Function test_chunk_large_data

atomic-core/src/change/format_v3/chunking.rs:793–809  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

791
792 #[test]
793 fn test_chunk_large_data() {
794 // 2 MB of pseudo-random data
795 let data: Vec<u8> = (0..2_000_000u64)
796 .map(|i| {
797 // Simple PRNG for deterministic "random" data
798 ((i.wrapping_mul(6364136223846793005)
799 .wrapping_add(1442695040888963407))
800 >> 33) as u8
801 })
802 .collect();
803 let chunks = chunk_content(&data, &ChunkingOptions::default());
804
805 // 2MB / 64KB avg ≈ 31 chunks
806 assert!(chunks.len() >= 5, "2MB should produce at least 5 chunks");
807
808 verify_chunks_cover_data(&data, &chunks);
809 }
810
811 #[test]
812 fn test_chunk_highly_repetitive_data() {

Callers

nothing calls this directly

Calls 2

chunk_contentFunction · 0.85
verify_chunks_cover_dataFunction · 0.85

Tested by

no test coverage detected