MCPcopy
hub / github.com/go-chi/chi / TestMountingExistingPath

Function TestMountingExistingPath

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

Source from the content-addressed store, hash-verified

1468}
1469
1470func TestMountingExistingPath(t *testing.T) {
1471 handler := func(w http.ResponseWriter, r *http.Request) {}
1472
1473 defer func() {
1474 if recover() == nil {
1475 t.Error("expected panic()")
1476 }
1477 }()
1478
1479 r := NewRouter()
1480 r.Get("/", handler)
1481 r.Mount("/hi", http.HandlerFunc(handler))
1482 r.Mount("/hi", http.HandlerFunc(handler))
1483}
1484
1485func TestMountingSimilarPattern(t *testing.T) {
1486 r := NewRouter()

Callers

nothing calls this directly

Calls 4

GetMethod · 0.95
MountMethod · 0.95
NewRouterFunction · 0.85
HandlerFuncMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…