()
| 480 | |
| 481 | #[test] |
| 482 | fn rate_function() { |
| 483 | if let Expr::Call { func, args } = p("rate(requests[5m])") { |
| 484 | assert_eq!(func, "rate"); |
| 485 | assert_eq!(args.len(), 1); |
| 486 | assert!(matches!(&args[0], Expr::MatrixSelector { .. })); |
| 487 | } else { |
| 488 | panic!("expected Call"); |
| 489 | } |
| 490 | } |
| 491 | |
| 492 | #[test] |
| 493 | fn binary_precedence() { |