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

Function TestWalkErrorMatcher

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

Source from the content-addressed store, hash-verified

1711}
1712
1713func TestWalkErrorMatcher(t *testing.T) {
1714 router := NewRouter()
1715 expectedError := router.Path("/g").Subrouter().Path("").GetError()
1716 err := router.Walk(func(route *Route, router *Router, ancestors []*Route) error {
1717 return route.GetError()
1718 })
1719 if err != expectedError {
1720 t.Errorf("Expected %v routes, found %v", expectedError, err)
1721 }
1722}
1723
1724func TestWalkErrorHandler(t *testing.T) {
1725 handler := NewRouter()

Callers

nothing calls this directly

Calls 5

PathMethod · 0.95
WalkMethod · 0.95
NewRouterFunction · 0.85
GetErrorMethod · 0.80
SubrouterMethod · 0.80

Tested by

no test coverage detected