(t *testing.T)
| 64 | } |
| 65 | |
| 66 | func TestRunEmpty(t *testing.T) { |
| 67 | os.Setenv("PORT", "") |
| 68 | router := New() |
| 69 | go func() { |
| 70 | router.GET("/example", func(c *Context) { c.String(http.StatusOK, "it worked") }) |
| 71 | assert.NoError(t, router.Run()) |
| 72 | }() |
| 73 | |
| 74 | // Wait for server to be ready with exponential backoff |
| 75 | err := waitForServerReady("http://localhost:8080/example", 10) |
| 76 | require.NoError(t, err, "server should start successfully") |
| 77 | |
| 78 | require.Error(t, router.Run(":8080")) |
| 79 | testRequest(t, "http://localhost:8080/example") |
| 80 | } |
| 81 | |
| 82 | func TestBadTrustedCIDRs(t *testing.T) { |
| 83 | router := New() |
nothing calls this directly
no test coverage detected