(t *testing.T, testCases []validationTestCase, f ValidatorCallback, funcName string)
| 12 | } |
| 13 | |
| 14 | func runValidationTests(t *testing.T, testCases []validationTestCase, f ValidatorCallback, funcName string) { |
| 15 | for _, tc := range testCases { |
| 16 | pass, value, _ := f(tc.input) |
| 17 | if pass != tc.expectedPass { |
| 18 | t.Errorf("%s(%s) passing is %v, expected %v", funcName, tc.input, pass, tc.expectedPass) |
| 19 | } |
| 20 | |
| 21 | if value != tc.expectedValue { |
| 22 | t.Errorf("%s(%s) got new value %v, expected %v", funcName, tc.input, value, tc.expectedValue) |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func TestParseInput(t *testing.T) { |
| 28 | testCases := []validationTestCase{ |
no outgoing calls
no test coverage detected