Spaces:
Paused
Paused
Download pkg/utils/path_test.go from dan92/cloudfilestoragemgr: direct link, hf CLI and curl.
- Browser
- Download file 538 Bytes
-
https://huggingface.co/spaces/dan92/cloudfilestoragemgr/resolve/main/pkg/utils/path_test.go
- Command line
-
hf download hf://spaces/dan92/cloudfilestoragemgr/pkg/utils/path_test.go
-
curl -L -o path_test.go https://huggingface.co/spaces/dan92/cloudfilestoragemgr/resolve/main/pkg/utils/path_test.go
538 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) | |
| } | |
| } | |
| } | |