| 11 | ) |
| 12 | |
| 13 | func 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 | |
| 32 | func TestConfig_Module(t *testing.T) { |
| 33 | tests := map[string]struct { |