(t *testing.T)
| 194 | } |
| 195 | |
| 196 | func TestAtomicLevelServeHTTPBrokenWriter(t *testing.T) { |
| 197 | t.Parallel() |
| 198 | |
| 199 | lvl := zap.NewAtomicLevel() |
| 200 | |
| 201 | request, err := http.NewRequest(http.MethodGet, "http://localhost:1234/log/level", nil) |
| 202 | require.NoError(t, err, "Error constructing request.") |
| 203 | |
| 204 | recorder := httptest.NewRecorder() |
| 205 | lvl.ServeHTTP(&brokenHTTPResponseWriter{ |
| 206 | ResponseWriter: recorder, |
| 207 | }, request) |
| 208 | |
| 209 | assert.Equal(t, http.StatusInternalServerError, recorder.Code, "Unexpected status code.") |
| 210 | } |
| 211 | |
| 212 | type brokenHTTPResponseWriter struct { |
| 213 | http.ResponseWriter |
nothing calls this directly
no test coverage detected