()
| 635 | |
| 636 | #[test] |
| 637 | fn approx_percentile_basic() { |
| 638 | let docs: Vec<Vec<u8>> = (1..=100).map(|i| encode(&json!({"val": i}))).collect(); |
| 639 | let refs: Vec<&[u8]> = docs.iter().map(|d| d.as_slice()).collect(); |
| 640 | let result = compute_aggregate_binary("approx_percentile", "0.5:val", None, &refs); |
| 641 | if let Value::Float(f) = result { |
| 642 | assert!( |
| 643 | (f - 50.0).abs() < 10.0, |
| 644 | "p50 of 1..100 should be ~50, got {f}" |
| 645 | ); |
| 646 | } else { |
| 647 | panic!("expected Float, got {result:?}"); |
| 648 | } |
| 649 | } |
| 650 | |
| 651 | #[test] |
| 652 | fn approx_topk_basic() { |
nothing calls this directly
no test coverage detected