Home / Function/ Test_CookieJar_PathMatch() — fiber Function Reference

Test_CookieJar_PathMatch() — fiber Function Reference

Architecture documentation for the Test_CookieJar_PathMatch() function in cookiejar_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  f6614c66_00eb_8318_b084_110d097b263a["Test_CookieJar_PathMatch()"]
  cd50e15b_65b6_b061_b1e6_e10e95a06bf6["cookiejar_test.go"]
  f6614c66_00eb_8318_b084_110d097b263a -->|defined in| cd50e15b_65b6_b061_b1e6_e10e95a06bf6
  style f6614c66_00eb_8318_b084_110d097b263a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

client/cookiejar_test.go lines 289–315

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

	jar := &CookieJar{}

	setURI := fasthttp.AcquireURI()
	require.NoError(t, setURI.Parse(nil, []byte("http://example.com/api")))

	c := &fasthttp.Cookie{}
	c.SetKey("k")
	c.SetValue("v")
	c.SetPath("/api")

	jar.Set(setURI, c)

	uriExact := fasthttp.AcquireURI()
	require.NoError(t, uriExact.Parse(nil, []byte("http://example.com/api")))
	require.Len(t, jar.Get(uriExact), 1)

	uriChild := fasthttp.AcquireURI()
	require.NoError(t, uriChild.Parse(nil, []byte("http://example.com/api/v1")))
	require.Len(t, jar.Get(uriChild), 1)

	uriNoMatch := fasthttp.AcquireURI()
	require.NoError(t, uriNoMatch.Parse(nil, []byte("http://example.com/apiv1")))
	require.Empty(t, jar.Get(uriNoMatch))
}

Domain

Subdomains

Frequently Asked Questions

What does Test_CookieJar_PathMatch() do?
Test_CookieJar_PathMatch() is a function in the fiber codebase, defined in client/cookiejar_test.go.
Where is Test_CookieJar_PathMatch() defined?
Test_CookieJar_PathMatch() is defined in client/cookiejar_test.go at line 289.

Analyze Your Own Codebase

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

Try Supermodel Free