mirror of
https://github.com/golang/go.git
synced 2024-09-29 06:17:11 +00:00
path/filepath: add test case for rooted ".."
R=golang-dev, r CC=golang-dev https://golang.org/cl/6350047
This commit is contained in:
parent
8357dc9015
commit
8907f94a51
@ -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"},
|
||||
|
Loading…
Reference in New Issue
Block a user