MCPcopy
hub / github.com/wavetermdev/waveterm / TestParseURI_WSHWSL

Function TestParseURI_WSHWSL

pkg/remote/connparse/connparse_test.go:327–359  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

325}
326
327func TestParseURI_WSHWSL(t *testing.T) {
328 t.Parallel()
329 cstr := "wsh://wsl://Ubuntu/path/to/file"
330
331 testUri := func() {
332 c, err := connparse.ParseURI(cstr)
333 if err != nil {
334 t.Fatalf("failed to parse URI: %v", err)
335 }
336 expected := "/path/to/file"
337 if c.Path != expected {
338 t.Fatalf("expected path to be \"%q\", got \"%q\"", expected, c.Path)
339 }
340 expected = "wsl://Ubuntu"
341 if c.Host != expected {
342 t.Fatalf("expected host to be \"%q\", got \"%q\"", expected, c.Host)
343 }
344 expected = "wsh"
345 if c.Scheme != expected {
346 t.Fatalf("expected scheme to be \"%q\", got \"%q\"", expected, c.Scheme)
347 }
348 expected = "wsh://wsl://Ubuntu/path/to/file"
349 if expected != c.GetFullURI() {
350 t.Fatalf("expected full URI to be \"%q\", got \"%q\"", expected, c.GetFullURI())
351 }
352 }
353 t.Log("Testing with scheme")
354 testUri()
355
356 t.Log("Testing without scheme")
357 cstr = "//wsl://Ubuntu/path/to/file"
358 testUri()
359}
360
361func TestParseUri_LocalWindowsAbsPath(t *testing.T) {
362 t.Parallel()

Callers

nothing calls this directly

Calls 3

ParseURIFunction · 0.92
GetFullURIMethod · 0.80
LogMethod · 0.80

Tested by

no test coverage detected