MCPcopy
hub / github.com/gofiber/fiber / Test_CookieBinder_Bind_ParseError

Function Test_CookieBinder_Bind_ParseError

binder/cookie_test.go:89–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

87}
88
89func Test_CookieBinder_Bind_ParseError(t *testing.T) {
90 b := &CookieBinding{}
91 type User struct {
92 Age int `cookie:"age"`
93 }
94 var user User
95 req := fasthttp.AcquireRequest()
96 req.Header.SetCookie("age", "invalid")
97 t.Cleanup(func() { fasthttp.ReleaseRequest(req) })
98 err := b.Bind(req, &user)
99 require.Error(t, err)
100}

Callers

nothing calls this directly

Calls 3

BindMethod · 0.95
ErrorMethod · 0.65
SetCookieMethod · 0.45

Tested by

no test coverage detected