File: aggr_test.go

package info (click to toggle)
golang-github-victoriametrics-metricsql 0.84.3%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 344 kB
  • sloc: makefile: 2
file content (30 lines) | stat: -rw-r--r-- 477 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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")
}