MCPcopy Create free account
hub / github.com/prometheus/common / testLabelNames

Function testLabelNames

model/labels_test.go:21–45  ·  view source on GitHub ↗
(t testing.TB)

Source from the content-addressed store, hash-verified

19)
20
21func testLabelNames(t testing.TB) {
22 scenarios := []struct {
23 in LabelNames
24 out LabelNames
25 }{
26 {
27 in: LabelNames{"ZZZ", "zzz"},
28 out: LabelNames{"ZZZ", "zzz"},
29 },
30 {
31 in: LabelNames{"aaa", "AAA"},
32 out: LabelNames{"AAA", "aaa"},
33 },
34 }
35
36 for i, scenario := range scenarios {
37 sort.Sort(scenario.in)
38
39 for j, expected := range scenario.out {
40 if expected != scenario.in[j] {
41 t.Errorf("%d.%d expected %s, got %s", i, j, expected, scenario.in[j])
42 }
43 }
44 }
45}
46
47func TestLabelNames(t *testing.T) {
48 testLabelNames(t)

Callers 2

TestLabelNamesFunction · 0.85
BenchmarkLabelNamesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected