()
| 501 | |
| 502 | #[test] |
| 503 | fn aggregation_by() { |
| 504 | if let Expr::Aggregate { op, grouping, .. } = p("sum by (job) (rate(requests[5m]))") { |
| 505 | assert_eq!(op, AggOp::Sum); |
| 506 | assert_eq!(grouping, Grouping::By(vec!["job".into()])); |
| 507 | } else { |
| 508 | panic!("expected Aggregate"); |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | #[test] |
| 513 | fn topk_with_param() { |