MCPcopy Index your code
hub / github.com/netdata/netdata / TestParamSelection_StringAndJSON

Function TestParamSelection_StringAndJSON

src/go/pkg/funcapi/enums_test.go:161–179  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

159}
160
161func TestParamSelection_StringAndJSON(t *testing.T) {
162 cases := []struct {
163 value ParamSelection
164 expected string
165 }{
166 {ParamSelect, "select"},
167 {ParamMultiSelect, "multiselect"},
168 {ParamSelection(250), "select"},
169 }
170
171 for _, tc := range cases {
172 t.Run(tc.expected, func(t *testing.T) {
173 assert.Equal(t, tc.expected, tc.value.String())
174 data, err := json.Marshal(tc.value)
175 require.NoError(t, err)
176 assert.Equal(t, `"`+tc.expected+`"`, string(data))
177 })
178 }
179}

Callers

nothing calls this directly

Calls 4

ParamSelectionTypeAlias · 0.85
EqualMethod · 0.80
RunMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…