Skip to content

Commit

Permalink
Update PathClean test strings
Browse files Browse the repository at this point in the history
  • Loading branch information
julienschmidt committed Dec 14, 2013
1 parent 29a9e74 commit cdd9d50
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ var cleanTests = []struct {
path, result string
}{
// Already clean
{"/", "/"},
{"/abc", "/abc"},
{"/a/b/c", "/a/b/c"},
{"/abc/", "/abc/"},
{"/a/b/c/", "/a/b/c/"},

// missing root
{"", "/"},
{"abc", "/abc"},
{"abc/def", "/abc/def"},
{"a/b/c", "/a/b/c"},
{"/", "/"},
{"../..", "/"},
{"../../abc", "/abc"},

// Remove doubled slash
{"//", "/"},
Expand All @@ -43,6 +47,8 @@ var cleanTests = []struct {
{"..", "/"},
{"../", "/"},
{"../../", "/"},
{"../..", "/"},
{"../../abc", "/abc"},
{"/abc/def/ghi/../jkl", "/abc/def/jkl"},
{"/abc/def/../ghi/../jkl", "/abc/jkl"},
{"/abc/def/..", "/abc"},
Expand Down

0 comments on commit cdd9d50

Please sign in to comment.