MCPcopy
hub / github.com/gorilla/mux / TestWalkErrorRoute

Function TestWalkErrorRoute

mux_test.go:1701–1711  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1699}
1700
1701func TestWalkErrorRoute(t *testing.T) {
1702 router := NewRouter()
1703 router.Path("/g")
1704 expectedError := errors.New("error")
1705 err := router.Walk(func(route *Route, router *Router, ancestors []*Route) error {
1706 return expectedError
1707 })
1708 if err != expectedError {
1709 t.Errorf("Expected %v routes, found %v", expectedError, err)
1710 }
1711}
1712
1713func TestWalkErrorMatcher(t *testing.T) {
1714 router := NewRouter()

Callers

nothing calls this directly

Calls 3

PathMethod · 0.95
WalkMethod · 0.95
NewRouterFunction · 0.85

Tested by

no test coverage detected