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

Function testLabelValues

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

Source from the content-addressed store, hash-verified

56}
57
58func testLabelValues(t testing.TB) {
59 scenarios := []struct {
60 in LabelValues
61 out LabelValues
62 }{
63 {
64 in: LabelValues{"ZZZ", "zzz"},
65 out: LabelValues{"ZZZ", "zzz"},
66 },
67 {
68 in: LabelValues{"aaa", "AAA"},
69 out: LabelValues{"AAA", "aaa"},
70 },
71 }
72
73 for i, scenario := range scenarios {
74 sort.Sort(scenario.in)
75
76 for j, expected := range scenario.out {
77 if expected != scenario.in[j] {
78 t.Errorf("%d.%d expected %s, got %s", i, j, expected, scenario.in[j])
79 }
80 }
81 }
82}
83
84func TestLabelValues(t *testing.T) {
85 testLabelValues(t)

Callers 2

TestLabelValuesFunction · 0.85
BenchmarkLabelValuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected