MCPcopy
hub / github.com/gin-gonic/gin / testRoutes

Function testRoutes

tree_test.go:376–392  ·  view source on GitHub ↗
(t *testing.T, routes []testRoute)

Source from the content-addressed store, hash-verified

374}
375
376func 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
394func TestTreeWildcardConflict(t *testing.T) {
395 routes := []testRoute{

Callers 5

TestTreeWildcardConflictFunction · 0.85
TestCatchAllAfterSlashFunction · 0.85
TestTreeChildConflictFunction · 0.85
TestTreeCatchAllConflictFunction · 0.85

Calls 2

addRouteMethod · 0.95
catchPanicFunction · 0.85

Tested by

no test coverage detected