Home / Function/ Test_Bind_Cookie_Map() — fiber Function Reference

Test_Bind_Cookie_Map() — fiber Function Reference

Architecture documentation for the Test_Bind_Cookie_Map() function in bind_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  40215238_6b0e_35c3_c069_ccbbbd3e3713["Test_Bind_Cookie_Map()"]
  55065b01_f5dc_4e53_5a74_5ecc7aca8f52["bind_test.go"]
  40215238_6b0e_35c3_c069_ccbbbd3e3713 -->|defined in| 55065b01_f5dc_4e53_5a74_5ecc7aca8f52
  style 40215238_6b0e_35c3_c069_ccbbbd3e3713 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

bind_test.go lines 1579–1607

func Test_Bind_Cookie_Map(t *testing.T) {
	t.Parallel()

	app := New(Config{
		EnableSplittingOnParsers: true,
	})
	c := app.AcquireCtx(&fasthttp.RequestCtx{})

	c.Request().SetBody([]byte(``))
	c.Request().Header.SetContentType("")

	c.Request().Header.SetCookie("id", "1")
	c.Request().Header.SetCookie("Name", "John Doe")
	c.Request().Header.SetCookie("Hobby", "golang,fiber")
	q := make(map[string][]string)
	require.NoError(t, c.Bind().Cookie(&q))
	require.Len(t, q["Hobby"], 2)

	c.Request().Header.DelCookie("hobby")
	c.Request().Header.SetCookie("Hobby", "golang,fiber,go")
	q = make(map[string][]string)
	require.NoError(t, c.Bind().Cookie(&q))
	require.Len(t, q["Hobby"], 3)

	empty := make(map[string][]string)
	c.Request().Header.DelCookie("hobby")
	require.NoError(t, c.Bind().Query(&empty))
	require.Empty(t, empty["Hobby"])
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_Bind_Cookie_Map() do?
Test_Bind_Cookie_Map() is a function in the fiber codebase, defined in bind_test.go.
Where is Test_Bind_Cookie_Map() defined?
Test_Bind_Cookie_Map() is defined in bind_test.go at line 1579.

Analyze Your Own Codebase

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

Try Supermodel Free