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

Function all_exceptions

nodedb-codec/src/alp.rs:523–531  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

521
522 #[test]
523 fn all_exceptions() {
524 // All values are irrational — all exceptions.
525 let values: Vec<f64> = (1..100).map(|i| std::f64::consts::PI * i as f64).collect();
526 let encoded = encode(&values);
527 let decoded = decode(&encoded).unwrap();
528 for (i, (a, b)) in values.iter().zip(decoded.iter()).enumerate() {
529 assert_eq!(a.to_bits(), b.to_bits(), "mismatch at {i}");
530 }
531 }
532
533 #[test]
534 fn encodability_check() {

Callers

nothing calls this directly

Calls 4

collectMethod · 0.80
encodeFunction · 0.70
decodeFunction · 0.70
iterMethod · 0.45

Tested by

no test coverage detected