From: Han-Wen Nienhuys Date: Thu, 28 Jun 2012 16:46:44 +0000 (-0700) Subject: path/filepath: add test case for rooted ".." X-Git-Tag: go1.1rc2~2861 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8907f94a51345ef738692df611edb710fc555f5a;p=gostls13.git path/filepath: add test case for rooted ".." R=golang-dev, r CC=golang-dev https://golang.org/cl/6350047 --- diff --git a/src/pkg/path/filepath/path_test.go b/src/pkg/path/filepath/path_test.go index ec6af4db7e..ef554dd7fa 100644 --- a/src/pkg/path/filepath/path_test.go +++ b/src/pkg/path/filepath/path_test.go @@ -20,7 +20,6 @@ type PathTest struct { var cleantests = []PathTest{ // Already clean - {"", "."}, {"abc", "abc"}, {"abc/def", "abc/def"}, {"a/b/c", "a/b/c"}, @@ -31,6 +30,9 @@ var cleantests = []PathTest{ {"/abc", "/abc"}, {"/", "/"}, + // Empty is current dir + {"", "."}, + // Remove trailing slash {"abc/", "abc"}, {"abc/def/", "abc/def"}, @@ -61,6 +63,7 @@ var cleantests = []PathTest{ {"abc/def/../../..", ".."}, {"/abc/def/../../..", "/"}, {"abc/def/../../../ghi/jkl/../../../mno", "../../mno"}, + {"/../abc", "/abc"}, // Combinations {"abc/./../def", "def"},