(t *testing.T)
| 688 | } |
| 689 | |
| 690 | func Test_Route_Match_Middleware_HasPrefix(t *testing.T) { |
| 691 | t.Parallel() |
| 692 | |
| 693 | app := New() |
| 694 | |
| 695 | app.Use("/foo", func(c Ctx) error { |
| 696 | return c.SendString("middleware") |
| 697 | }) |
| 698 | |
| 699 | resp, err := app.Test(httptest.NewRequest(MethodGet, "/foo/bar", http.NoBody)) |
| 700 | require.NoError(t, err, "app.Test(req)") |
| 701 | require.Equal(t, 200, resp.StatusCode, "Status code") |
| 702 | |
| 703 | body, err := io.ReadAll(resp.Body) |
| 704 | require.NoError(t, err, "app.Test(req)") |
| 705 | require.Equal(t, "middleware", app.toString(body)) |
| 706 | } |
| 707 | |
| 708 | func Test_Route_Match_Middleware_NoBoundary(t *testing.T) { |
| 709 | t.Parallel() |
nothing calls this directly
no test coverage detected