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

Function TestValidationScheme_String

model/metric_test.go:111–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

109}
110
111func TestValidationScheme_String(t *testing.T) {
112 for _, tc := range []struct {
113 name string
114 scheme ValidationScheme
115 want string
116 }{
117 {
118 name: "Unset",
119 scheme: UnsetValidation,
120 want: "unset",
121 },
122 {
123 name: "Legacy",
124 scheme: LegacyValidation,
125 want: "legacy",
126 },
127 {
128 name: "UTF8",
129 scheme: UTF8Validation,
130 want: "utf8",
131 },
132 } {
133 t.Run(tc.name, func(t *testing.T) {
134 require.Equal(t, tc.want, tc.scheme.String())
135 })
136 }
137}
138
139func TestValidationScheme_MarshalYAML(t *testing.T) {
140 for _, tc := range []struct {

Callers

nothing calls this directly

Calls 2

StringMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected