(t *testing.T)
| 325 | } |
| 326 | |
| 327 | func 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 | |
| 361 | func TestParseUri_LocalWindowsAbsPath(t *testing.T) { |
| 362 | t.Parallel() |
nothing calls this directly
no test coverage detected