MCPcopy
hub / github.com/julienschmidt/httprouter / TestEmptyWildcardName

Function TestEmptyWildcardName

tree_test.go:311–328  ·  tree_test.go::TestEmptyWildcardName
(t *testing.T)

Source from the content-addressed store, hash-verified

309}
310
311func TestEmptyWildcardName(t *testing.T) {
312 tree := &node{}
313
314 routes := [...]string{
315 "/user:",
316 "/user:/",
317 "/cmd/:/",
318 "/src/*",
319 }
320 for _, route := range routes {
321 recv := catchPanic(func() {
322 tree.addRoute(route, nil)
323 })
324 if recv == nil {
325 t.Fatalf("no panic while inserting route with empty wildcard name '%s", route)
326 }
327 }
328}
329
330func TestTreeCatchAllConflict(t *testing.T) {
331 routes := []testRoute{

Callers

nothing calls this directly

Calls 2

addRouteMethod · 0.95
catchPanicFunction · 0.85

Tested by

no test coverage detected