mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
30 lines
477 B
Go
30 lines
477 B
Go
package metricsql
|
|
|
|
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")
|
|
}
|