(t *testing.T, ep *Entrypoint, match []string, noMatch []string)
| 44 | } |
| 45 | |
| 46 | func run(t *testing.T, ep *Entrypoint, match []string, noMatch []string) { |
| 47 | t.Helper() |
| 48 | |
| 49 | server, ok := ep.GetServer(":" + strconv.Itoa(testHTTPRouteListenPort)) |
| 50 | require.True(t, ok, "server not found") |
| 51 | require.NotNil(t, server) |
| 52 | |
| 53 | for _, test := range match { |
| 54 | t.Run(test, func(t *testing.T) { |
| 55 | route := server.FindRoute(test) |
| 56 | assert.NotNil(t, route) |
| 57 | }) |
| 58 | } |
| 59 | |
| 60 | for _, test := range noMatch { |
| 61 | t.Run(test, func(t *testing.T) { |
| 62 | route := server.FindRoute(test) |
| 63 | assert.Nil(t, route) |
| 64 | |
| 65 | found, ok := ep.HTTPRoutes().Get(test) |
| 66 | assert.False(t, ok) |
| 67 | assert.Nil(t, found) |
| 68 | }) |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | func TestFindRouteAnyDomain(t *testing.T) { |
| 73 | ep := NewTestEntrypoint(t, nil) |
no test coverage detected