--------------------------------------------------------------------------- Correctness — Insert + Search ---------------------------------------------------------------------------
(t *testing.T)
| 22 | // --------------------------------------------------------------------------- |
| 23 | |
| 24 | func TestRouter_Static_ExactMatch(t *testing.T) { |
| 25 | r := newTestRouter() |
| 26 | insertRoute(r, "GET", "/hello") |
| 27 | |
| 28 | h, params, found := r.Search("GET", "/hello") |
| 29 | if !found { |
| 30 | t.Fatal("expected to find /hello") |
| 31 | } |
| 32 | if len(h) == 0 { |
| 33 | t.Fatal("expected handlers to be non-empty") |
| 34 | } |
| 35 | if len(params) != 0 { |
| 36 | t.Errorf("expected no params, got %v", params) |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | func TestRouter_Static_NoFalsePositive(t *testing.T) { |
| 41 | r := newTestRouter() |
nothing calls this directly
no test coverage detected