(t *testing.T)
| 732 | } |
| 733 | |
| 734 | func TestRouterFromMuxWith(t *testing.T) { |
| 735 | t.Parallel() |
| 736 | |
| 737 | r := NewRouter() |
| 738 | |
| 739 | with := r.With(func(next http.Handler) http.Handler { |
| 740 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 741 | next.ServeHTTP(w, r) |
| 742 | }) |
| 743 | }) |
| 744 | |
| 745 | with.Get("/with_middleware", func(w http.ResponseWriter, r *http.Request) {}) |
| 746 | |
| 747 | ts := httptest.NewServer(with) |
| 748 | defer ts.Close() |
| 749 | |
| 750 | // Without the fix this test was committed with, this causes a panic. |
| 751 | testRequest(t, ts, http.MethodGet, "/with_middleware", nil) |
| 752 | } |
| 753 | |
| 754 | func TestMuxMiddlewareStack(t *testing.T) { |
| 755 | var stdmwInit, stdmwHandler uint64 |
nothing calls this directly
no test coverage detected