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

Function TestRouter_addEmptyPathToSlashReverse

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

Source from the content-addressed store, hash-verified

2647}
2648
2649func TestRouter_addEmptyPathToSlashReverse(t *testing.T) {
2650 r := NewRouter(RouterConfig{})
2651 _, err := r.Add(Route{Method: http.MethodGet, Path: "", Handler: handlerFunc, Name: "empty"})
2652 assert.NoError(t, err)
2653
2654 reversed, err := r.Routes().Reverse("empty") // empty path is normalized to `/` internally but stays "" in route
2655
2656 assert.NoError(t, err)
2657 assert.Equal(t, "", reversed)
2658}
2659
2660func TestRouter_ReverseNotFound(t *testing.T) {
2661 r := NewRouter(RouterConfig{})

Callers

nothing calls this directly

Calls 4

AddMethod · 0.95
RoutesMethod · 0.95
NewRouterFunction · 0.85
ReverseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…