MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / int_sort_order

Function int_sort_order

nodedb-columnar/src/pk_index.rs:323–339  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321
322 #[test]
323 fn int_sort_order() {
324 // Verify that encoded integers sort correctly (including negatives).
325 let values = [-100i64, -1, 0, 1, 100];
326 let encoded: Vec<Vec<u8>> = values
327 .iter()
328 .map(|v| encode_pk(&Value::Integer(*v)))
329 .collect();
330
331 for i in 0..encoded.len() - 1 {
332 assert!(
333 encoded[i] < encoded[i + 1],
334 "sort order broken: {} < {}",
335 values[i],
336 values[i + 1]
337 );
338 }
339 }
340
341 #[test]
342 fn pk_index_roundtrip_segment_id_above_u32_max() {

Callers

nothing calls this directly

Calls 4

encode_pkFunction · 0.85
collectMethod · 0.80
iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected