(t *testing.T)
| 90 | } |
| 91 | |
| 92 | func TestParseBool(t *testing.T) { |
| 93 | testCases := []struct { |
| 94 | input string |
| 95 | expectedPass bool |
| 96 | expectedValue bool |
| 97 | expectedError string |
| 98 | }{ |
| 99 | {"true", true, true, ""}, |
| 100 | {"false", true, false, ""}, |
| 101 | {"not a bool", false, false, "could not be parsed into a boolean"}, |
| 102 | } |
| 103 | |
| 104 | for _, tc := range testCases { |
| 105 | pass, value, _ := ParseBool(tc.input) |
| 106 | if pass != tc.expectedPass { |
| 107 | t.Errorf("ParseBool(%s) passing is %v, expected %v", tc.input, pass, tc.expectedPass) |
| 108 | } |
| 109 | |
| 110 | if value != tc.expectedValue { |
| 111 | t.Errorf("ParseBool(%s) got new value %v, expected %v", tc.input, value, tc.expectedValue) |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | func TestIsPresent(t *testing.T) { |
| 117 | testCases := []validationTestCase{ |
nothing calls this directly
no test coverage detected