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

Function Test_NextCustom_Matched404

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

Source from the content-addressed store, hash-verified

2031}
2032
2033func Test_NextCustom_Matched404(t *testing.T) {
2034 t.Parallel()
2035 app := newCustomApp()
2036 app.RebuildTree()
2037
2038 fctx := &fasthttp.RequestCtx{}
2039 fctx.Request.Header.SetMethod(MethodGet)
2040 fctx.Request.SetRequestURI("/none")
2041
2042 ctx := app.AcquireCtx(fctx)
2043 ctx.setMatched(true)
2044 defer app.ReleaseCtx(ctx)
2045
2046 matched, err := app.nextCustom(ctx)
2047 require.False(t, matched)
2048 var e *Error
2049 require.ErrorAs(t, err, &e)
2050 require.Equal(t, StatusNotFound, e.Code)
2051}
2052
2053func Test_NextCustom_SkipMountAndNoHandlers(t *testing.T) {
2054 t.Parallel()

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected