(t *testing.T)
| 122 | } |
| 123 | |
| 124 | func 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 | // --------------------------------------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected
searching dependent graphs…