Home / Function/ TestContextStream() — gin Function Reference

TestContextStream() — gin Function Reference

Architecture documentation for the TestContextStream() function in context_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  c4041480_1ce7_a951_259c_9e49c2236507["TestContextStream()"]
  0e74e95c_7721_b1fe_e017_3622be489053["CreateTestResponseRecorder()"]
  c4041480_1ce7_a951_259c_9e49c2236507 -->|calls| 0e74e95c_7721_b1fe_e017_3622be489053
  style c4041480_1ce7_a951_259c_9e49c2236507 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

context_test.go lines 3006–3023

func TestContextStream(t *testing.T) {
	w := CreateTestResponseRecorder()
	c, _ := CreateTestContext(w)

	stopStream := true
	c.Stream(func(w io.Writer) bool {
		defer func() {
			stopStream = false
		}()

		_, err := w.Write([]byte("test"))
		require.NoError(t, err)

		return stopStream
	})

	assert.Equal(t, "testtest", w.Body.String())
}

Domain

Subdomains

Frequently Asked Questions

What does TestContextStream() do?
TestContextStream() is a function in the gin codebase.
What does TestContextStream() call?
TestContextStream() calls 1 function(s): CreateTestResponseRecorder.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free