zipora 3.1.5

High-performance Rust implementation providing advanced data structures and compression algorithms with memory safety guarantees. Features LRU page cache, sophisticated caching layer, fiber-based concurrency, real-time compression, secure memory pools, SIMD optimizations, and complete C FFI for migration from C++.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use zipora::algorithms::radix_sort::KeyValueRadixSort;

#[test]
fn test_radix_kv_duplicate_keys() {
    let mut data: Vec<(u64, String)> = vec![
        (5, "A".to_string()),
        (2, "B".to_string()),
        (5, "C".to_string()),
        (1, "D".to_string()),
    ];
    let sorter = KeyValueRadixSort::new();
    sorter.sort_by_key(&mut data).unwrap();
    
    // Expected: [(1, "D"), (2, "B"), (5, "A"), (5, "C")]
    // If it finds the first match for 5, it'll output "A" twice instead of "A" and "C"
    let values: Vec<String> = data.into_iter().map(|(_, v)| v).collect();
    assert_eq!(values, vec!["D".to_string(), "B".to_string(), "A".to_string(), "C".to_string()]);
}