MCPcopy
hub / github.com/labstack/echo / TestRouterFillsRequestPatternField

Function TestRouterFillsRequestPatternField

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

Source from the content-addressed store, hash-verified

672}
673
674func TestRouterFillsRequestPatternField(t *testing.T) {
675 path := "/folders/a/files/echo.gif"
676 req := httptest.NewRequest(http.MethodGet, path, nil)
677 rec := httptest.NewRecorder()
678
679 e := New()
680 e.GET(path, handlerFunc)
681
682 c := e.NewContext(req, rec)
683 _ = e.router.Route(c)
684
685 assert.Equal(t, path, c.Path())
686 assert.Equal(t, path, c.Request().Pattern)
687}
688
689func TestRouterStatic(t *testing.T) {
690 path := "/folders/a/files/echo.gif"

Callers

nothing calls this directly

Calls 6

PathMethod · 0.95
RequestMethod · 0.95
NewFunction · 0.85
NewContextMethod · 0.80
RouteMethod · 0.65
GETMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…