MCPcopy Create free account
hub / github.com/AdRoll/baker / assertValidConfigHelp

Function assertValidConfigHelp

help_test.go:15–34  ·  view source on GitHub ↗
(t *testing.T, name string, cfg interface{})

Source from the content-addressed store, hash-verified

13)
14
15func assertValidConfigHelp(t *testing.T, name string, cfg interface{}) {
16 t.Helper()
17
18 tCfg := reflect.TypeOf(cfg).Elem()
19
20 if tCfg.Kind() != reflect.Struct {
21 t.Errorf("Got %v, struct expected", tCfg.Kind())
22 }
23
24 for i := 0; i < tCfg.NumField(); i++ {
25 if tCfg.Field(i).PkgPath != "" {
26 // This is an unexported field
27 continue
28 }
29
30 if tCfg.Field(i).Tag.Get("help") == "" {
31 t.Errorf("%v is missing the config help for %v", name, tCfg.Field(i).Name)
32 }
33 }
34}
35
36func TestAllInputsHaveConfigHelp(t *testing.T) {
37 for _, input := range input.All {

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected