Home / Function/ Test_Logger_AppendUint() — fiber Function Reference

Test_Logger_AppendUint() — fiber Function Reference

Architecture documentation for the Test_Logger_AppendUint() function in logger_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  3a6e2391_2874_222c_d1fc_ba6bc13106d9["Test_Logger_AppendUint()"]
  97b45bc9_01a3_2a9a_4c94_9de1344ca94c["logger_test.go"]
  3a6e2391_2874_222c_d1fc_ba6bc13106d9 -->|defined in| 97b45bc9_01a3_2a9a_4c94_9de1344ca94c
  style 3a6e2391_2874_222c_d1fc_ba6bc13106d9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/logger/logger_test.go lines 778–809

func Test_Logger_AppendUint(t *testing.T) {
	t.Parallel()
	app := fiber.New()

	buf := bytebufferpool.Get()
	defer bytebufferpool.Put(buf)

	app.Use(New(Config{
		Format: "${bytesReceived} ${bytesSent} ${status}",
		Stream: buf,
	}))

	app.Get("/", func(c fiber.Ctx) error {
		return c.SendString("hello")
	})

	app.Get("/content", func(c fiber.Ctx) error {
		c.Response().Header.SetContentLength(5)
		return c.SendString("hello")
	})

	resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody))
	require.NoError(t, err)
	require.Equal(t, fiber.StatusOK, resp.StatusCode)
	require.Equal(t, "-2 0 200", buf.String())

	buf.Reset()
	resp, err = app.Test(httptest.NewRequest(fiber.MethodGet, "/content", http.NoBody))
	require.NoError(t, err)
	require.Equal(t, fiber.StatusOK, resp.StatusCode)
	require.Equal(t, "-2 5 200", buf.String())
}

Domain

Subdomains

Frequently Asked Questions

What does Test_Logger_AppendUint() do?
Test_Logger_AppendUint() is a function in the fiber codebase, defined in middleware/logger/logger_test.go.
Where is Test_Logger_AppendUint() defined?
Test_Logger_AppendUint() is defined in middleware/logger/logger_test.go at line 778.

Analyze Your Own Codebase

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

Try Supermodel Free