(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestRouter_MultipleParams(t *testing.T) { |
| 74 | r := newTestRouter() |
| 75 | r.Insert("GET", "/user/:id/post/:postId", []Handler{func(c *Ctx) error { return nil }}) |
| 76 | |
| 77 | _, params, found := r.Search("GET", "/user/7/post/99") |
| 78 | if !found { |
| 79 | t.Fatal("expected match") |
| 80 | } |
| 81 | if params["id"] != "7" { |
| 82 | t.Errorf("expected id=7, got %q", params["id"]) |
| 83 | } |
| 84 | if params["postId"] != "99" { |
| 85 | t.Errorf("expected postId=99, got %q", params["postId"]) |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | func TestRouter_DeepNesting(t *testing.T) { |
| 90 | r := newTestRouter() |
nothing calls this directly
no test coverage detected