Home / Function/ Test_App_SmallReadBuffer() — fiber Function Reference

Test_App_SmallReadBuffer() — fiber Function Reference

Architecture documentation for the Test_App_SmallReadBuffer() function in app_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  f0750fe6_2ff3_9147_c39f_7ce1b2c3e77a["Test_App_SmallReadBuffer()"]
  e728fdd2_242f_706b_c1d2_041b3d6badb5["app_test.go"]
  f0750fe6_2ff3_9147_c39f_7ce1b2c3e77a -->|defined in| e728fdd2_242f_706b_c1d2_041b3d6badb5
  style f0750fe6_2ff3_9147_c39f_7ce1b2c3e77a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

app_test.go lines 2282–2308

func Test_App_SmallReadBuffer(t *testing.T) {
	t.Parallel()
	app := New(Config{
		ReadBufferSize: 1,
	})

	app.Get("/small-read-buffer", func(c Ctx) error {
		return c.SendString("I should not be sent")
	})

	ln, err := net.Listen(NetworkTCP4, "127.0.0.1:0")
	require.NoError(t, err)
	addr := ln.Addr().String()

	go func() {
		time.Sleep(500 * time.Millisecond)
		req, err := http.NewRequestWithContext(context.Background(), MethodGet, fmt.Sprintf("http://%s/small-read-buffer", addr), http.NoBody)
		assert.NoError(t, err)
		var client http.Client
		resp, err := client.Do(req)
		assert.NoError(t, err)
		assert.Equal(t, 431, resp.StatusCode)
		assert.NoError(t, app.Shutdown())
	}()

	require.NoError(t, app.Listener(ln, ListenConfig{DisableStartupMessage: true}))
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_App_SmallReadBuffer() do?
Test_App_SmallReadBuffer() is a function in the fiber codebase, defined in app_test.go.
Where is Test_App_SmallReadBuffer() defined?
Test_App_SmallReadBuffer() is defined in app_test.go at line 2282.

Analyze Your Own Codebase

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

Try Supermodel Free