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

Function testLabelValues

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

Source from the content-addressed store, hash-verified

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

Callers 2

TestLabelValuesFunction · 0.85
BenchmarkLabelValuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected