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

Function TestMuxMatch_HasBasePath

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

Source from the content-addressed store, hash-verified

1843}
1844
1845func TestMuxMatch_HasBasePath(t *testing.T) {
1846 r := NewRouter()
1847 r.Get("/", func(w http.ResponseWriter, r *http.Request) {
1848 w.Header().Set("X-Test", "yes")
1849 w.Write([]byte(""))
1850 })
1851
1852 tctx := NewRouteContext()
1853
1854 tctx.Reset()
1855 if r.Match(tctx, "GET", "/") != true {
1856 t.Fatal("expecting to find match for route:", "GET", "/")
1857 }
1858}
1859
1860func TestMuxMatch_DoesNotHaveBasePath(t *testing.T) {
1861 r := NewRouter()

Callers

nothing calls this directly

Calls 6

GetMethod · 0.95
NewRouterFunction · 0.85
NewRouteContextFunction · 0.85
WriteMethod · 0.65
ResetMethod · 0.65
MatchMethod · 0.65

Tested by

no test coverage detected