mirror of https://github.com/gin-gonic/gin.git
Add cleanPath test data
This commit is contained in:
parent
4f721a42ea
commit
1b54ec9567
|
@ -116,7 +116,9 @@ func BenchmarkCleanPath(b *testing.B) {
|
|||
"/abc/def/..", "/abc/def/../..",
|
||||
"/abc/def/../../..", "/abc/def/../../..",
|
||||
"/abc/def/../../../ghi/jkl/../../../mno",
|
||||
"abc/..def", "abc/./...", "abc/a../...", "abc/a..z",
|
||||
"abc/./../def", "abc//./../def", "abc/../../././../def",
|
||||
"abc/./../..def", "abc/../.../..def", "abc/.//../..def",
|
||||
}
|
||||
|
||||
for _, function := range functions {
|
||||
|
|
10
path_test.go
10
path_test.go
|
@ -60,10 +60,20 @@ var cleanTests = []struct {
|
|||
{"/abc/def/../../..", "/"},
|
||||
{"/abc/def/../../../ghi/jkl/../../../mno", "/mno"},
|
||||
|
||||
// Keep .. elements
|
||||
{"abc/..def", "/abc/..def"},
|
||||
{"abc/./...", "/abc/..."},
|
||||
{"abc/a../...", "/abc/a../..."},
|
||||
{"abc/a..z", "/abc/a..z"},
|
||||
|
||||
// Combinations
|
||||
{"abc/./../def", "/def"},
|
||||
{"abc//./../def", "/def"},
|
||||
{"abc/../../././../def", "/def"},
|
||||
{"abc/../../././../...", "/..."},
|
||||
{"abc/./../..def", "/..def"},
|
||||
{"abc/../.../..def", "/.../..def"},
|
||||
{"abc/.//../..def", "/..def"},
|
||||
}
|
||||
|
||||
func TestPathClean(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue