aboutsummaryrefslogtreecommitdiff
path: root/src/path/filepath/path_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/path/filepath/path_test.go')
-rw-r--r--src/path/filepath/path_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/path/filepath/path_test.go b/src/path/filepath/path_test.go
index 697bcc672d..1a2e53a795 100644
--- a/src/path/filepath/path_test.go
+++ b/src/path/filepath/path_test.go
@@ -66,6 +66,7 @@ var cleantests = []PathTest{
{"/abc/def/../../..", "/"},
{"abc/def/../../../ghi/jkl/../../../mno", "../../mno"},
{"/../abc", "/abc"},
+ {"a/../b:/../../c", `../c`},
// Combinations
{"abc/./../def", "def"},
@@ -88,6 +89,7 @@ var wincleantests = []PathTest{
{`c:\abc\def\..\..`, `c:\`},
{`c:\..\abc`, `c:\abc`},
{`c:..\abc`, `c:..\abc`},
+ {`c:\b:\..\..\..\d`, `c:\d`},
{`\`, `\`},
{`/`, `\`},
{`\\i\..\c$`, `\\i\..\c$`},
@@ -168,6 +170,7 @@ var islocaltests = []IsLocalTest{
{"a/", true},
{"a/.", true},
{"a/./b/./c", true},
+ {`a/../b:/../../c`, false},
}
var winislocaltests = []IsLocalTest{
@@ -379,6 +382,7 @@ var winjointests = []JoinTest{
{[]string{`\\a`, `b`, `c`}, `\\a\b\c`},
{[]string{`\\a\`, `b`, `c`}, `\\a\b\c`},
{[]string{`//`, `a`}, `\\a`},
+ {[]string{`a:\b\c`, `x\..\y:\..\..\z`}, `a:\b\z`},
}
func TestJoin(t *testing.T) {