MCPcopy
hub / github.com/netdata/netdata / TestConfig_Name

Function TestConfig_Name

src/go/plugin/framework/confgroup/config_test.go:13–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestConfig_Name(t *testing.T) {
14 tests := map[string]struct {
15 cfg Config
16 expected any
17 }{
18 "string": {cfg: Config{"name": "name"}, expected: "name"},
19 "empty string": {cfg: Config{"name": ""}, expected: ""},
20 "not string": {cfg: Config{"name": 0}, expected: ""},
21 "not set": {cfg: Config{}, expected: ""},
22 "nil cfg": {expected: ""},
23 }
24
25 for name, test := range tests {
26 t.Run(name, func(t *testing.T) {
27 assert.Equal(t, test.expected, test.cfg.Name())
28 })
29 }
30}
31
32func TestConfig_Module(t *testing.T) {
33 tests := map[string]struct {

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.80
RunMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…