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

Function TestRouter_SearchAnyMethod

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

Source from the content-addressed store, hash-verified

156}
157
158func TestRouter_SearchAnyMethod(t *testing.T) {
159 r := newTestRouter()
160 insertRoute(r, "GET", "/data")
161
162 _, _, found := r.SearchAnyMethod("/data")
163 if !found {
164 t.Error("SearchAnyMethod should find /data registered under GET")
165 }
166 _, _, found = r.SearchAnyMethod("/unknown")
167 if found {
168 t.Error("SearchAnyMethod should not find unregistered path")
169 }
170}
171
172// ---------------------------------------------------------------------------
173// Edge cases

Callers

nothing calls this directly

Calls 4

newTestRouterFunction · 0.85
insertRouteFunction · 0.85
SearchAnyMethodMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected