Home / File/ cookiejar_test.go — fiber Source File

cookiejar_test.go — fiber Source File

Architecture documentation for cookiejar_test.go, a go file in the fiber codebase. 1 imports, 0 dependents.

File go FiberClient Hooks 1 imports 11 functions

Entity Profile

Dependency Diagram

graph LR
  cd50e15b_65b6_b061_b1e6_e10e95a06bf6["cookiejar_test.go"]
  c0b86961_3ef1_0168_52fc_98627566ed27["bytes"]
  cd50e15b_65b6_b061_b1e6_e10e95a06bf6 --> c0b86961_3ef1_0168_52fc_98627566ed27
  style cd50e15b_65b6_b061_b1e6_e10e95a06bf6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

package client

import (
	"bytes"
	"testing"
	"time"

	"github.com/stretchr/testify/require"
	"github.com/valyala/fasthttp"
)

func checkKeyValue(t *testing.T, cj *CookieJar, cookie *fasthttp.Cookie, uri *fasthttp.URI, n int) {
	t.Helper()

	cs := cj.Get(uri)
	require.GreaterOrEqual(t, len(cs), n)

	c := cs[n-1]
	require.NotNil(t, c)

	require.Equal(t, string(c.Key()), string(cookie.Key()))
	require.Equal(t, string(c.Value()), string(cookie.Value()))
}

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

	url := []byte("http://fasthttp.com/")
	url1 := []byte("http://fasthttp.com/make/")
	url11 := []byte("http://fasthttp.com/hola")
	url2 := []byte("http://fasthttp.com/make/fasthttp")
	url3 := []byte("http://fasthttp.com/make/fasthttp/great")
	cj := &CookieJar{}

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

	c2 := &fasthttp.Cookie{}
	c2.SetKey("kk")
	c2.SetValue("vv")
	c2.SetPath("/make/fasthttp")

	c3 := &fasthttp.Cookie{}
	c3.SetKey("kkk")
	c3.SetValue("vvv")
	c3.SetPath("/make/fasthttp/great")

	uri := fasthttp.AcquireURI()
	require.NoError(t, uri.Parse(nil, url))

	uri1 := fasthttp.AcquireURI()
	require.NoError(t, uri1.Parse(nil, url1))

	uri11 := fasthttp.AcquireURI()
	require.NoError(t, uri11.Parse(nil, url11))

	uri2 := fasthttp.AcquireURI()
	require.NoError(t, uri2.Parse(nil, url2))
// ... (256 more lines)

Domain

Subdomains

Dependencies

  • bytes

Frequently Asked Questions

What does cookiejar_test.go do?
cookiejar_test.go is a source file in the fiber codebase, written in go. It belongs to the FiberClient domain, Hooks subdomain.
What functions are defined in cookiejar_test.go?
cookiejar_test.go defines 11 function(s): Test_CookieJarGet, Test_CookieJarGetExpired, Test_CookieJarGetFromResponse, Test_CookieJarSet, Test_CookieJarSetKeyValue, Test_CookieJarSetRepeatedCookieKeys, Test_CookieJar_Domain, Test_CookieJar_HostPort, Test_CookieJar_PathMatch, Test_CookieJar_Secure, and 1 more.
What does cookiejar_test.go depend on?
cookiejar_test.go imports 1 module(s): bytes.
Where is cookiejar_test.go in the architecture?
cookiejar_test.go is located at client/cookiejar_test.go (domain: FiberClient, subdomain: Hooks, directory: client).

Analyze Your Own Codebase

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

Try Supermodel Free