(t *testing.T, name string, cfg interface{})
| 13 | ) |
| 14 | |
| 15 | func 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 | |
| 36 | func TestAllInputsHaveConfigHelp(t *testing.T) { |
| 37 | for _, input := range input.All { |
no test coverage detected