(t *testing.T)
| 264 | } |
| 265 | |
| 266 | func TestMuxEmptyRoutes(t *testing.T) { |
| 267 | mux := NewRouter() |
| 268 | |
| 269 | apiRouter := NewRouter() |
| 270 | // oops, we forgot to declare any route handlers |
| 271 | |
| 272 | mux.Handle("/api*", apiRouter) |
| 273 | |
| 274 | if _, body := testHandler(t, mux, "GET", "/", nil); body != "404 page not found\n" { |
| 275 | t.Fatal(body) |
| 276 | } |
| 277 | |
| 278 | if _, body := testHandler(t, apiRouter, "GET", "/", nil); body != "404 page not found\n" { |
| 279 | t.Fatal(body) |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | // Test a mux that routes a trailing slash, see also middleware/strip_test.go |
| 284 | // for an example of using a middleware to handle trailing slashes. |
nothing calls this directly
no test coverage detected