athunderx / pkg /utils /path_test.go
Mr.L
feat: add full alist source code for Docker build
7107f0b
raw
history blame contribute delete
516 Bytes
package utils
import "testing"
func TestEncodePath(t *testing.T) {
t.Log(EncodePath("http://localhost:5244/d/123#.png"))
}
func TestFixAndCleanPath(t *testing.T) {
datas := map[string]string{
"": "/",
".././": "/",
"../../.../": "/...",
"x//\\y/": "/x/y",
".././.x/.y/.//..x../..y..": "/.x/.y/..x../..y..",
}
for key, value := range datas {
if FixAndCleanPath(key) != value {
t.Logf("raw %s fix fail", key)
}
}
}