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

Function Test_NextCustom_NotFound

router_test.go:2001–2018  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1999}
2000
2001func Test_NextCustom_NotFound(t *testing.T) {
2002 t.Parallel()
2003 app := newCustomApp()
2004 app.RebuildTree()
2005
2006 fctx := &fasthttp.RequestCtx{}
2007 fctx.Request.Header.SetMethod(MethodGet)
2008 fctx.Request.SetRequestURI("/not-exist")
2009
2010 ctx := app.AcquireCtx(fctx)
2011 defer app.ReleaseCtx(ctx)
2012
2013 matched, err := app.nextCustom(ctx)
2014 require.False(t, matched)
2015 var e *Error
2016 require.ErrorAs(t, err, &e)
2017 require.Equal(t, StatusNotFound, e.Code)
2018}
2019
2020func Test_RequestHandler_CustomCtx_NotImplemented(t *testing.T) {
2021 t.Parallel()

Callers

nothing calls this directly

Calls 6

newCustomAppFunction · 0.85
RebuildTreeMethod · 0.80
SetMethodMethod · 0.80
AcquireCtxMethod · 0.80
ReleaseCtxMethod · 0.80
nextCustomMethod · 0.80

Tested by

no test coverage detected