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

Function TestRouterTwoParam

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

Source from the content-addressed store, hash-verified

991}
992
993func TestRouterTwoParam(t *testing.T) {
994 e := New()
995 e.GET("/users/:uid/files/:fid", handlerFunc)
996
997 c := e.NewContext(httptest.NewRequest(http.MethodGet, "/users/1/files/1", nil), nil)
998 _ = e.router.Route(c)
999
1000 assert.Equal(t, "/users/:uid/files/:fid", c.Path())
1001 assert.Equal(t, "1", c.pathValues.GetOr("uid", ""))
1002 assert.Equal(t, "1", c.pathValues.GetOr("fid", ""))
1003}
1004
1005// Issue #378
1006func TestRouterParamWithSlash(t *testing.T) {

Callers

nothing calls this directly

Calls 6

PathMethod · 0.95
NewFunction · 0.85
NewContextMethod · 0.80
GetOrMethod · 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…