(t *testing.T)
| 22 | ) |
| 23 | |
| 24 | func TestMuxServeHTTP(t *testing.T) { |
| 25 | type stubPattern struct { |
| 26 | method string |
| 27 | ops []int |
| 28 | pool []string |
| 29 | verb string |
| 30 | } |
| 31 | for i, spec := range []struct { |
| 32 | patterns []stubPattern |
| 33 | |
| 34 | reqMethod string |
| 35 | reqPath string |
| 36 | headers map[string]string |
| 37 | |
| 38 | respStatus int |
| 39 | respContent string |
| 40 | |
| 41 | disablePathLengthFallback bool |
| 42 | unescapingMode runtime.UnescapingMode |
| 43 | }{ |
| 44 | { |
| 45 | patterns: nil, |
| 46 | reqMethod: "GET", |
| 47 | reqPath: "/", |
| 48 | respStatus: http.StatusNotFound, |
| 49 | }, |
| 50 | { |
| 51 | patterns: []stubPattern{ |
| 52 | { |
| 53 | method: "GET", |
| 54 | ops: []int{int(utilities.OpLitPush), 0}, |
| 55 | pool: []string{"foo"}, |
| 56 | }, |
| 57 | }, |
| 58 | reqMethod: "GET", |
| 59 | reqPath: "/foo", |
| 60 | respStatus: http.StatusOK, |
| 61 | respContent: "GET /foo", |
| 62 | }, |
| 63 | { |
| 64 | patterns: []stubPattern{ |
| 65 | { |
| 66 | method: "GET", |
| 67 | ops: []int{int(utilities.OpLitPush), 0}, |
| 68 | pool: []string{"foo"}, |
| 69 | }, |
| 70 | }, |
| 71 | reqMethod: "GET", |
| 72 | reqPath: "/bar", |
| 73 | respStatus: http.StatusNotFound, |
| 74 | }, |
| 75 | { |
| 76 | patterns: []stubPattern{ |
| 77 | { |
| 78 | method: "GET", |
| 79 | ops: []int{int(utilities.OpPush), 0}, |
| 80 | }, |
| 81 | { |
nothing calls this directly
no test coverage detected