(t *testing.T)
| 31 | } |
| 32 | |
| 33 | func TestSimple(t *testing.T) { |
| 34 | structValidation := &StructValidation{ |
| 35 | StructFieldValidations: []*StructFieldValidation{ |
| 36 | { |
| 37 | // Key: "key1", |
| 38 | StructField: "Key1", |
| 39 | BoolValidation: &BoolValidation{ |
| 40 | Required: true, |
| 41 | }, |
| 42 | }, |
| 43 | { |
| 44 | // Key: "key2", |
| 45 | StructField: "Key2", |
| 46 | BoolValidation: &BoolValidation{ |
| 47 | Default: true, |
| 48 | }, |
| 49 | }, |
| 50 | }, |
| 51 | Required: true, |
| 52 | ShortCircuit: true, |
| 53 | } |
| 54 | |
| 55 | configData := MustReadYAMLStr( |
| 56 | ` |
| 57 | key1: true |
| 58 | `) |
| 59 | |
| 60 | expected := &SimpleConfig{ |
| 61 | Key1: true, |
| 62 | Key2: true, |
| 63 | } |
| 64 | |
| 65 | testConfig(structValidation, configData, expected, t) |
| 66 | } |
| 67 | |
| 68 | type NestedConfig struct { |
| 69 | Key0 float64 `json:"key0"` |
nothing calls this directly
no test coverage detected