@@ -397,8 +397,8 @@ func TestParseSuccess(t *testing.T) {
397397 another (`group_left / (sum(1, 2))` , `group_left / sum(1, 2)` )
398398
399399 // parensExpr
400- another (`(-foo + ((bar) / (baz))) + ((23))` , `0 - foo + bar / baz + 23` )
401- another (`(FOO + ((Bar) / (baZ))) + ((23))` , `FOO + Bar / baZ + 23` )
400+ another (`(-foo + ((bar) / (baz))) + ((23))` , `0 - foo + ( bar / baz) + 23` )
401+ another (`(FOO + ((Bar) / (baZ))) + ((23))` , `FOO + ( Bar / baZ) + 23` )
402402 same (`(foo, bar)` )
403403 another (`((foo, bar),(baz))` , `((foo, bar), baz)` )
404404 same (`(foo, (bar, baz), ((x, y), (z, y), xx))` )
@@ -488,7 +488,7 @@ func TestParseSuccess(t *testing.T) {
488488 another (`with (foo(bar) = {__name__!="bar"}) foo(x)` , `{__name__!="bar"}` )
489489 another (`with (foo(bar) = bar{__name__="bar"}) foo(x)` , `x` )
490490 another (`with (foo\-bar(baz) = baz + baz) foo\-bar((x,y))` , `(x, y) + (x, y)` )
491- another (`with (foo\-bar(baz) = baz + baz) foo\-bar(x*y)` , `x * y + x * y` )
491+ another (`with (foo\-bar(baz) = baz + baz) foo\-bar(x*y)` , `( x * y) + ( x * y) ` )
492492 another (`with (foo\-bar(baz) = baz + baz) foo\-bar(x\*y)` , `x\*y + x\*y` )
493493 another (`with (foo\-bar(b\ az) = b\ az + b\ az) foo\-bar(x\*y)` , `x\*y + x\*y` )
494494
@@ -572,7 +572,7 @@ func TestParseSuccess(t *testing.T) {
572572 // Verify nested with exprs
573573 another (`with (f(x) = (with(x=y) x) + x) f(z)` , `y + z` )
574574 another (`with (x=foo) clamp_min(a, with (y=x) y)` , `clamp_min(a, foo)` )
575- another (`with (x=foo) a * x + (with (y=x) y) / y` , `a * foo + foo / y` )
575+ another (`with (x=foo) a * x + (with (y=x) y) / y` , `( a * foo) + ( foo / y) ` )
576576 another (`with (x = with (y = foo) y + x) x/x` , `(foo + x) / (foo + x)` )
577577 another (`with (
578578 x = {foo="bar"},
@@ -583,7 +583,7 @@ func TestParseSuccess(t *testing.T) {
583583 )
584584 z(foo) / changes(x)
585585 )
586- f(a)` , `(a + foo * m{foo="bar",y="1"}) / changes(a)` )
586+ f(a)` , `(a + ( foo * m{foo="bar",y="1"}) ) / changes(a)` )
587587
588588 // complex withExpr
589589 another (`WITH (
@@ -601,7 +601,7 @@ func TestParseSuccess(t *testing.T) {
601601 f(x, y) = x2(x) + x*y + x2(y)
602602 )
603603 f(a, 3)
604- ` , `a ^ 2 + a * 3 + 9` )
604+ ` , `( a ^ 2) + ( a * 3) + 9` )
605605 another (`WITH (
606606 x2(x) = x^2,
607607 f(x, y) = x2(x) + x*y + x2(y)
@@ -633,7 +633,7 @@ func TestParseSuccess(t *testing.T) {
633633 another (`with (rate(a,b)=a+b) rate(1,2)` , `3` )
634634 another (`with (now=now(), sum=sum()) x` , `x` )
635635 another (`with (rate(a) = b) c` , `c` )
636- another (`rate(x) + with (rate(a,b)=a*b) rate(2,b)` , `rate(x) + 2 * b` )
636+ another (`rate(x) + with (rate(a,b)=a*b) rate(2,b)` , `rate(x) + ( 2 * b) ` )
637637 another (`with (sum(a,b)=a+b) sum(c,d)` , `c + d` )
638638
639639 // $__interval and $__rate_interval must be replaced with 1i
0 commit comments