(t *testing.T)
| 720 | } |
| 721 | |
| 722 | func Test_Route_Match_Middleware_Root(t *testing.T) { |
| 723 | t.Parallel() |
| 724 | |
| 725 | app := New() |
| 726 | |
| 727 | app.Use("/", func(c Ctx) error { |
| 728 | return c.SendString("middleware") |
| 729 | }) |
| 730 | |
| 731 | resp, err := app.Test(httptest.NewRequest(MethodGet, "/everything", http.NoBody)) |
| 732 | require.NoError(t, err, "app.Test(req)") |
| 733 | require.Equal(t, 200, resp.StatusCode, "Status code") |
| 734 | |
| 735 | body, err := io.ReadAll(resp.Body) |
| 736 | require.NoError(t, err, "app.Test(req)") |
| 737 | require.Equal(t, "middleware", app.toString(body)) |
| 738 | } |
| 739 | |
| 740 | func Test_Router_Register_Missing_Handler(t *testing.T) { |
| 741 | t.Parallel() |
nothing calls this directly
no test coverage detected