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

Function TestLabelSet_String

model/labelset_test.go:124–154  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

122}
123
124func TestLabelSet_String(t *testing.T) {
125 tests := []struct {
126 input LabelSet
127 want string
128 }{
129 {
130 input: nil,
131 want: `{}`,
132 }, {
133 input: LabelSet{
134 "foo": "bar",
135 },
136 want: `{foo="bar"}`,
137 }, {
138 input: LabelSet{
139 "foo": "bar",
140 "foo2": "bar",
141 "abc": "prometheus",
142 "foo11": "bar11",
143 },
144 want: `{abc="prometheus", foo="bar", foo11="bar11", foo2="bar"}`,
145 },
146 }
147 for _, tt := range tests {
148 t.Run("test", func(t *testing.T) {
149 if got := tt.input.String(); got != tt.want {
150 t.Errorf("LabelSet.String() = %v, want %v", got, tt.want)
151 }
152 })
153 }
154}
155
156// Benchmark Results for LabelSet's String() method
157// ---------------------------------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…