parseTestCheckNoError checks the error return from Parse*() against the test case expectations. Returns true the test should proceed to checking the actual data returned from Parse*(), or false if the test is finished. Test helper for SYS-REQ-012, SYS-REQ-013, SYS-REQ-014, and SYS-REQ-015.
(t *testing.T, testKind string, test ParseTest, value interface{}, err error)
| 2150 | // Returns true the test should proceed to checking the actual data returned from Parse*(), or false if the test is finished. |
| 2151 | // Test helper for SYS-REQ-012, SYS-REQ-013, SYS-REQ-014, and SYS-REQ-015. |
| 2152 | func parseTestCheckNoError(t *testing.T, testKind string, test ParseTest, value interface{}, err error) bool { |
| 2153 | if isErr := (err != nil); test.isErr != isErr { |
| 2154 | // If the call didn't match the error expectation, fail |
| 2155 | t.Errorf("%s test '%s' isErr mismatch: expected %t, obtained %t (err %v). Obtained value: %v", testKind, test.in, test.isErr, isErr, err, value) |
| 2156 | return false |
| 2157 | } else if isErr { |
| 2158 | // Else, if there was an error, don't fail and don't check isFound or the value |
| 2159 | return false |
| 2160 | } else { |
| 2161 | // Else, there was no error and a value was found, so check the value |
| 2162 | return true |
| 2163 | } |
| 2164 | } |
| 2165 | |
| 2166 | // Test helper for SYS-REQ-012, SYS-REQ-013, SYS-REQ-014, and SYS-REQ-015. |
| 2167 | func runParseTests(t *testing.T, testKind string, tests []ParseTest, runner func(ParseTest) (interface{}, error), resultChecker func(ParseTest, interface{}) (bool, interface{})) { |
no outgoing calls
no test coverage detected
searching dependent graphs…