MCPcopy Create free account
hub / github.com/BryanMwangi/pine / TestRouter_DeepNesting

Function TestRouter_DeepNesting

router_test.go:89–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

87}
88
89func TestRouter_DeepNesting(t *testing.T) {
90 r := newTestRouter()
91 r.Insert("GET", "/a/b/c/d/e/:f", []Handler{func(c *Ctx) error { return nil }})
92
93 _, params, found := r.Search("GET", "/a/b/c/d/e/leaf")
94 if !found {
95 t.Fatal("expected match on deep nesting")
96 }
97 if params["f"] != "leaf" {
98 t.Errorf("expected f=leaf, got %q", params["f"])
99 }
100}
101
102func TestRouter_Wildcard(t *testing.T) {
103 r := newTestRouter()

Callers

nothing calls this directly

Calls 3

newTestRouterFunction · 0.85
InsertMethod · 0.80
SearchMethod · 0.80

Tested by

no test coverage detected