MCPcopy Index your code
hub / github.com/labstack/echo / TestRouterParamWithSlash

Function TestRouterParamWithSlash

router_test.go:1006–1019  ·  view source on GitHub ↗

Issue #378

(t *testing.T)

Source from the content-addressed store, hash-verified

1004
1005// Issue #378
1006func TestRouterParamWithSlash(t *testing.T) {
1007 e := New()
1008
1009 e.GET("/a/:b/c/d/:e", handlerFunc)
1010 e.GET("/a/:b/c/:d/:f", handlerFunc)
1011
1012 c := e.NewContext(httptest.NewRequest(http.MethodGet, "/a/1/c/d/2/3", nil), nil)
1013 // `2/3` should mapped to path `/a/:b/c/d/:e` and into `:e`
1014 handler := e.router.Route(c)
1015
1016 err := handler(c)
1017 assert.Equal(t, "/a/:b/c/d/:e", c.Path())
1018 assert.NoError(t, err)
1019}
1020
1021// Issue #1754 - router needs to backtrack multiple levels upwards in tree to find the matching route
1022// route evaluation order

Callers

nothing calls this directly

Calls 5

PathMethod · 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…