(t *testing.T)
| 43 | } |
| 44 | |
| 45 | func TestSafeBuilderPool(t *testing.T) { |
| 46 | pool := newSafeBuilderPool() |
| 47 | builder := pool.Get() |
| 48 | builder.Set("name", "value") |
| 49 | lbls := builder.Labels() |
| 50 | |
| 51 | assert.Equal(t, labels.FromStrings("name", "value"), lbls) |
| 52 | |
| 53 | // Putting the builder back into the pool should reset it. |
| 54 | pool.Put(builder) |
| 55 | |
| 56 | reusedBuilder := pool.Get() |
| 57 | assert.Equal(t, builder, reusedBuilder) |
| 58 | assert.Equal(t, labels.EmptyLabels(), reusedBuilder.Labels()) |
| 59 | } |
| 60 | |
| 61 | type sanitizerFunc func(lbls labels.Labels) labels.Labels |
| 62 |
nothing calls this directly
no test coverage detected