diff --git a/promql/parser/parse_test.go b/promql/parser/parse_test.go index 3445fce067..14af0b16ae 100644 --- a/promql/parser/parse_test.go +++ b/promql/parser/parse_test.go @@ -3947,6 +3947,26 @@ var testExpr = []struct { }, }, }, + { + input: "(sum(foo))", + expected: &ParenExpr{ + Expr: &AggregateExpr{ + Op: SUM, + Expr: &VectorSelector{ + Name: "foo", + LabelMatchers: []*labels.Matcher{ + MustLabelMatcher(labels.MatchEqual, model.MetricNameLabel, "foo"), + }, + PosRange: posrange.PositionRange{ + Start: 5, + End: 8, + }, + }, + PosRange: posrange.PositionRange{Start: 1, End: 9}, + }, + PosRange: posrange.PositionRange{Start: 0, End: 10}, + }, + }, } func makeInt64Pointer(val int64) *int64 {