(t *testing.T, rr *httptest.ResponseRecorder)
| 40 | } |
| 41 | |
| 42 | func pathErrorCode(t *testing.T, rr *httptest.ResponseRecorder) string { |
| 43 | t.Helper() |
| 44 | var body struct { |
| 45 | Error struct { |
| 46 | Code string `json:"code"` |
| 47 | } `json:"error"` |
| 48 | } |
| 49 | if err := json.Unmarshal(rr.Body.Bytes(), &body); err != nil { |
| 50 | t.Fatalf("decode error body %q: %v", rr.Body.String(), err) |
| 51 | } |
| 52 | return body.Error.Code |
| 53 | } |
| 54 | |
| 55 | // TestValidatePathRejectsUnbindablePathText drives the REAL server (not |
| 56 | // ValidatePath directly) so it vouches for the middleware's BINDING as well |
no test coverage detected