()
| 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() { |