(t *testing.T, routes []testRoute)
| 374 | } |
| 375 | |
| 376 | func testRoutes(t *testing.T, routes []testRoute) { |
| 377 | tree := &node{} |
| 378 | |
| 379 | for _, route := range routes { |
| 380 | recv := catchPanic(func() { |
| 381 | tree.addRoute(route.path, nil) |
| 382 | }) |
| 383 | |
| 384 | if route.conflict { |
| 385 | if recv == nil { |
| 386 | t.Errorf("no panic for conflicting route '%s'", route.path) |
| 387 | } |
| 388 | } else if recv != nil { |
| 389 | t.Errorf("unexpected panic for route '%s': %v", route.path, recv) |
| 390 | } |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | func TestTreeWildcardConflict(t *testing.T) { |
| 395 | routes := []testRoute{ |
no test coverage detected