(t *testing.T)
| 3015 | } |
| 3016 | |
| 3017 | func TestContextStream(t *testing.T) { |
| 3018 | w := CreateTestResponseRecorder() |
| 3019 | c, _ := CreateTestContext(w) |
| 3020 | |
| 3021 | stopStream := true |
| 3022 | c.Stream(func(w io.Writer) bool { |
| 3023 | defer func() { |
| 3024 | stopStream = false |
| 3025 | }() |
| 3026 | |
| 3027 | _, err := w.Write([]byte("test")) |
| 3028 | require.NoError(t, err) |
| 3029 | |
| 3030 | return stopStream |
| 3031 | }) |
| 3032 | |
| 3033 | assert.Equal(t, "testtest", w.Body.String()) |
| 3034 | } |
| 3035 | |
| 3036 | func TestContextStreamWithClientGone(t *testing.T) { |
| 3037 | w := CreateTestResponseRecorder() |
nothing calls this directly
no test coverage detected