VictoriaMetrics/app/vmselect/promql/aggr_test.go

31 lines
474 B
Go
Raw Normal View History

2019-05-22 21:16:55 +00:00
package promql
import (
"testing"
)
func TestIsAggrFuncModifierSuccess(t *testing.T) {
f := func(s string) {
t.Helper()
if !isAggrFuncModifier(s) {
t.Fatalf("expecting valid funcModifier: %q", s)
}
}
f("by")
f("BY")
f("without")
f("Without")
}
func TestIsAggrFuncModifierError(t *testing.T) {
f := func(s string) {
t.Helper()
if isAggrFuncModifier(s) {
t.Fatalf("unexpected valid funcModifier: %q", s)
}
}
f("byfix")
f("on")
f("ignoring")
}