(t *testing.T)
| 603 | } |
| 604 | |
| 605 | func TestJoinRootPath(t *testing.T) { |
| 606 | for _, test := range []struct { |
| 607 | remote string |
| 608 | filePath string |
| 609 | want string |
| 610 | }{ |
| 611 | {"", "", ""}, |
| 612 | {"", "/", "/"}, |
| 613 | {"/", "", "/"}, |
| 614 | {"/", "/", "/"}, |
| 615 | {"/", "//", "/"}, |
| 616 | {"/root", "", "/root"}, |
| 617 | {"/root", "/", "/root"}, |
| 618 | {"/root", "//", "/root"}, |
| 619 | {"/a/b", "", "/a/b"}, |
| 620 | {"//", "/", "//"}, |
| 621 | {"//server", "path", "//server/path"}, |
| 622 | {"//server/sub", "path", "//server/sub/path"}, |
| 623 | {"//server", "//path", "//server/path"}, |
| 624 | {"//server/sub", "//path", "//server/sub/path"}, |
| 625 | {"//", "/", "//"}, |
| 626 | {"//server", "path", "//server/path"}, |
| 627 | {"//server/sub", "path", "//server/sub/path"}, |
| 628 | {"//server", "//path", "//server/path"}, |
| 629 | {"//server/sub", "//path", "//server/sub/path"}, |
| 630 | {filepath.FromSlash("//server/sub"), filepath.FromSlash("//path"), "//server/sub/path"}, |
| 631 | {"s3:", "", "s3:"}, |
| 632 | {"s3:", ".", "s3:"}, |
| 633 | {"s3:.", ".", "s3:"}, |
| 634 | {"s3:", "..", "s3:"}, |
| 635 | {"s3:dir", "sub", "s3:dir/sub"}, |
| 636 | {"s3:dir", "/sub", "s3:dir/sub"}, |
| 637 | {"s3:dir", "./sub", "s3:dir/sub"}, |
| 638 | {"s3:/dir", "/sub/", "s3:/dir/sub"}, |
| 639 | {"s3:dir", "..", "s3:dir"}, |
| 640 | {"s3:dir", "/..", "s3:dir"}, |
| 641 | {"s3:dir", "/../", "s3:dir"}, |
| 642 | } { |
| 643 | got := JoinRootPath(test.remote, test.filePath) |
| 644 | assert.Equal(t, test.want, got, test) |
| 645 | } |
| 646 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…