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

Function identical_values

nodedb-codec/src/alp_rd.rs:330–339  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

328
329 #[test]
330 fn identical_values() {
331 let values = vec![42.0f64; 1000];
332 let encoded = encode(&values).unwrap();
333 let decoded = decode(&encoded).unwrap();
334 for (a, b) in values.iter().zip(decoded.iter()) {
335 assert_eq!(a.to_bits(), b.to_bits());
336 }
337 // Dictionary has 1 entry — should be smaller than raw.
338 assert!(encoded.len() < values.len() * 8);
339 }
340
341 #[test]
342 fn truncated_errors() {

Callers

nothing calls this directly

Calls 3

encodeFunction · 0.70
decodeFunction · 0.70
iterMethod · 0.45

Tested by

no test coverage detected