(t *testing.T)
| 264 | } |
| 265 | |
| 266 | func TestIsDERPPath(t *testing.T) { |
| 267 | t.Parallel() |
| 268 | |
| 269 | testcases := []struct { |
| 270 | path string |
| 271 | expected bool |
| 272 | }{ |
| 273 | //{ |
| 274 | // path: "/derp", |
| 275 | // expected: true, |
| 276 | // }, |
| 277 | { |
| 278 | path: "/derp/", |
| 279 | expected: true, |
| 280 | }, |
| 281 | { |
| 282 | path: "/derp/latency-check", |
| 283 | expected: true, |
| 284 | }, |
| 285 | { |
| 286 | path: "/derp/latency-check/", |
| 287 | expected: true, |
| 288 | }, |
| 289 | { |
| 290 | path: "", |
| 291 | expected: false, |
| 292 | }, |
| 293 | { |
| 294 | path: "/", |
| 295 | expected: false, |
| 296 | }, |
| 297 | { |
| 298 | path: "/derptastic", |
| 299 | expected: false, |
| 300 | }, |
| 301 | { |
| 302 | path: "/api/v2/derp", |
| 303 | expected: false, |
| 304 | }, |
| 305 | { |
| 306 | path: "//", |
| 307 | expected: false, |
| 308 | }, |
| 309 | } |
| 310 | for _, tc := range testcases { |
| 311 | t.Run(tc.path, func(t *testing.T) { |
| 312 | t.Parallel() |
| 313 | require.Equal(t, tc.expected, isDERPPath(tc.path)) |
| 314 | }) |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | func TestIsReplicaRelayRequest(t *testing.T) { |
| 319 | t.Parallel() |
nothing calls this directly
no test coverage detected