(t *testing.T)
| 1699 | } |
| 1700 | |
| 1701 | func 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 | |
| 1713 | func TestWalkErrorMatcher(t *testing.T) { |
| 1714 | router := NewRouter() |