MCPcopy Index your code
hub / github.com/AlistGo/alist / TestFixAndCleanPath

Function TestFixAndCleanPath

pkg/utils/path_test.go:9–22  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7}
8
9func TestFixAndCleanPath(t *testing.T) {
10 datas := map[string]string{
11 "": "/",
12 ".././": "/",
13 "../../.../": "/...",
14 "x//\\y/": "/x/y",
15 ".././.x/.y/.//..x../..y..": "/.x/.y/..x../..y..",
16 }
17 for key, value := range datas {
18 if FixAndCleanPath(key) != value {
19 t.Logf("raw %s fix fail", key)
20 }
21 }
22}
23
24func TestValidateNameComponent(t *testing.T) {
25 validNames := []string{

Callers

nothing calls this directly

Calls 1

FixAndCleanPathFunction · 0.85

Tested by

no test coverage detected