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

Function TestRouter_ReverseNotFound

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

Source from the content-addressed store, hash-verified

2658}
2659
2660func TestRouter_ReverseNotFound(t *testing.T) {
2661 r := NewRouter(RouterConfig{})
2662 _, err := r.Add(Route{Method: http.MethodGet, Path: "", Handler: handlerFunc, Name: "empty"})
2663 assert.NoError(t, err)
2664
2665 reversed, err := r.Routes().Reverse("not-existing")
2666
2667 assert.EqualError(t, err, "route not found")
2668 assert.Equal(t, "", reversed)
2669}
2670
2671func TestRoutes_ReverseHandlerName(t *testing.T) {
2672 static := func(*Context) error { return nil }

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…