Skip to content

Commit a8b5de4

Browse files
authored
Add test case for Response (#1557)
1 parent c29904d commit a8b5de4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

response_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,13 @@ func TestResponse_Write_UsesSetResponseCode(t *testing.T) {
4141
res.Write([]byte("test"))
4242
assert.Equal(t, http.StatusBadRequest, rec.Code)
4343
}
44+
45+
func TestResponse_Flush(t *testing.T) {
46+
e := New()
47+
rec := httptest.NewRecorder()
48+
res := &Response{echo: e, Writer: rec}
49+
50+
res.Write([]byte("test"))
51+
res.Flush()
52+
assert.True(t, rec.Flushed)
53+
}

0 commit comments

Comments
 (0)