MCPcopy
hub / github.com/grafana/tempo / TestLabelBuilder_Sanitizer

Function TestLabelBuilder_Sanitizer

modules/generator/registry/builder_test.go:69–78  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

67}
68
69func TestLabelBuilder_Sanitizer(t *testing.T) {
70 builder := NewLabelBuilder(0, 0, sanitizerFunc(func(_ labels.Labels) labels.Labels {
71 return labels.FromStrings("name", "sanitized_value")
72 }), newTestLabelLimiter())
73 builder.Add("name", "value")
74 lbls, ok := builder.CloseAndBuildLabels()
75
76 assert.True(t, ok)
77 assert.Equal(t, labels.FromStrings("name", "sanitized_value"), lbls)
78}

Callers

nothing calls this directly

Calls 6

AddMethod · 0.95
CloseAndBuildLabelsMethod · 0.95
NewLabelBuilderFunction · 0.85
sanitizerFuncFuncType · 0.85
newTestLabelLimiterFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected