(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestHTTPError_StatusCode(t *testing.T) { |
| 16 | var err error = &HTTPError{Code: http.StatusBadRequest, Message: "my error message"} |
| 17 | |
| 18 | code := 0 |
| 19 | var sc HTTPStatusCoder |
| 20 | if errors.As(err, &sc) { |
| 21 | code = sc.StatusCode() |
| 22 | } |
| 23 | assert.Equal(t, http.StatusBadRequest, code) |
| 24 | } |
| 25 | |
| 26 | func TestHTTPError_Error(t *testing.T) { |
| 27 | var testCases = []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…