MCPcopy
hub / github.com/gofiber/fiber / Test_Route_Match_Root

Function Test_Route_Match_Root

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

Source from the content-addressed store, hash-verified

297}
298
299func Test_Route_Match_Root(t *testing.T) {
300 t.Parallel()
301
302 app := New()
303
304 app.Get("/", func(c Ctx) error {
305 return c.SendString("root")
306 })
307
308 resp, err := app.Test(httptest.NewRequest(MethodGet, "/", http.NoBody))
309 require.NoError(t, err, "app.Test(req)")
310 require.Equal(t, 200, resp.StatusCode, "Status code")
311
312 body, err := io.ReadAll(resp.Body)
313 require.NoError(t, err, "app.Test(req)")
314 require.Equal(t, "root", app.toString(body))
315}
316
317func Test_Route_Match_Parser(t *testing.T) {
318 t.Parallel()

Callers

nothing calls this directly

Calls 5

TestMethod · 0.80
toStringMethod · 0.80
NewFunction · 0.70
GetMethod · 0.65
SendStringMethod · 0.65

Tested by

no test coverage detected