Commit 8907f94a authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys Committed by Rob Pike

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

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6350047
parent 8357dc90
......@@ -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"},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment