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

Function nan_equality

nodedb-vector/src/collection/payload_index.rs:652–663  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

650
651 #[test]
652 fn nan_equality() {
653 let mut idx = PayloadIndex::new("score", PayloadIndexKind::Equality);
654 idx.insert(0, &Value::Float(f64::NAN));
655 idx.insert(1, &Value::Float(f64::NAN));
656 idx.insert(2, &Value::Float(1.0));
657
658 // Both NaN-bearing nodes should be in the same bucket.
659 let bm = idx.equality(&Value::Float(f64::NAN)).unwrap();
660 assert_eq!(bm.len(), 2);
661 assert!(bm.contains(0));
662 assert!(bm.contains(1));
663 }
664
665 #[test]
666 fn null_value_indexed() {

Callers

nothing calls this directly

Calls 2

equalityMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected