MCPcopy Index your code
hub / github.com/coder/coder / TestIsDERPPath

Function TestIsDERPPath

cli/server_internal_test.go:266–316  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

264}
265
266func 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
318func TestIsReplicaRelayRequest(t *testing.T) {
319 t.Parallel()

Callers

nothing calls this directly

Calls 3

isDERPPathFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected