diff options
| author | Han-Wen Nienhuys <hanwen@google.com> | 2012-06-28 09:46:44 -0700 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2012-06-28 09:46:44 -0700 |
| commit | 8907f94a51345ef738692df611edb710fc555f5a (patch) | |
| tree | 4ede2e7e7fd0fd550c4732736b2bf593112c6b4f /src/pkg | |
| parent | 8357dc90152ff27670fd9dd880a455802e5abc7a (diff) | |
| download | go-8907f94a51345ef738692df611edb710fc555f5a.tar.xz | |
path/filepath: add test case for rooted ".."
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6350047
Diffstat (limited to 'src/pkg')
| -rw-r--r-- | src/pkg/path/filepath/path_test.go | 5 |
1 files changed, 4 insertions, 1 deletions
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"}, |
