mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-31 15:06:26 +00:00
wip
This commit is contained in:
parent
9903654e0f
commit
dc245f82f3
2 changed files with 5 additions and 2 deletions
|
@ -27,8 +27,7 @@ func (fa *filterAnd) String() string {
|
||||||
a := make([]string, len(filters))
|
a := make([]string, len(filters))
|
||||||
for i, f := range filters {
|
for i, f := range filters {
|
||||||
s := f.String()
|
s := f.String()
|
||||||
switch f.(type) {
|
if _, ok := f.(*filterOr); ok {
|
||||||
case *filterOr:
|
|
||||||
s = "(" + s + ")"
|
s = "(" + s + ")"
|
||||||
}
|
}
|
||||||
a[i] = s
|
a[i] = s
|
||||||
|
|
|
@ -594,6 +594,10 @@ func TestParseQuerySuccess(t *testing.T) {
|
||||||
f(`NOT foo AND bar OR baz`, `!foo bar or baz`)
|
f(`NOT foo AND bar OR baz`, `!foo bar or baz`)
|
||||||
f(`NOT (foo AND bar) OR baz`, `!(foo bar) or baz`)
|
f(`NOT (foo AND bar) OR baz`, `!(foo bar) or baz`)
|
||||||
f(`foo OR bar AND baz`, `foo or bar baz`)
|
f(`foo OR bar AND baz`, `foo or bar baz`)
|
||||||
|
f(`foo bar or baz xyz`, `foo bar or baz xyz`)
|
||||||
|
f(`foo (bar or baz) xyz`, `foo (bar or baz) xyz`)
|
||||||
|
f(`foo or bar baz or xyz`, `foo or bar baz or xyz`)
|
||||||
|
f(`(foo or bar) (baz or xyz)`, `(foo or bar) (baz or xyz)`)
|
||||||
f(`(foo OR bar) AND baz`, `(foo or bar) baz`)
|
f(`(foo OR bar) AND baz`, `(foo or bar) baz`)
|
||||||
|
|
||||||
// parens
|
// parens
|
||||||
|
|
Loading…
Reference in a new issue