(t *testing.T)
| 58 | } |
| 59 | |
| 60 | func TestRouter_SingleParam(t *testing.T) { |
| 61 | r := newTestRouter() |
| 62 | r.Insert("GET", "/user/:id", []Handler{func(c *Ctx) error { return nil }}) |
| 63 | |
| 64 | _, params, found := r.Search("GET", "/user/42") |
| 65 | if !found { |
| 66 | t.Fatal("expected match") |
| 67 | } |
| 68 | if params["id"] != "42" { |
| 69 | t.Errorf("expected id=42, got %q", params["id"]) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | func TestRouter_MultipleParams(t *testing.T) { |
| 74 | r := newTestRouter() |
nothing calls this directly
no test coverage detected