path/filepath: add test case for rooted ".."

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6350047
This commit is contained in:
Han-Wen Nienhuys 2012-06-28 09:46:44 -07:00 committed by Rob Pike
parent 8357dc9015
commit 8907f94a51

View File

@ -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"},