MCPcopy
hub / github.com/prometheus/client_golang / TestBuildFQName

Function TestBuildFQName

prometheus/metric_test.go:29–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27)
28
29func TestBuildFQName(t *testing.T) {
30 scenarios := []struct{ namespace, subsystem, name, result string }{
31 {"a", "b", "c", "a_b_c"},
32 {"", "b", "c", "b_c"},
33 {"a", "", "c", "a_c"},
34 {"", "", "c", "c"},
35 {"a", "b", "", ""},
36 {"a", "", "", ""},
37 {"", "b", "", ""},
38 {" ", "", "", ""},
39 }
40
41 for i, s := range scenarios {
42 if want, got := s.result, BuildFQName(s.namespace, s.subsystem, s.name); want != got {
43 t.Errorf("%d. want %s, got %s", i, want, got)
44 }
45 }
46}
47
48func TestWithExemplarsMetric(t *testing.T) {
49 t.Run("histogram", func(t *testing.T) {

Callers

nothing calls this directly

Calls 1

BuildFQNameFunction · 0.85

Tested by

no test coverage detected