10 log.SetFlags(log.Flags() | log.Lshortfile)
13 func TestSafePath(t *testing.T) {
14 for _, _case := range []struct {
19 {input: []string{"a", filepath.FromSlash(`b/../../..`)}, expectErr: true},
20 {input: []string{"a", filepath.FromSlash(`b/../.././..`)}, expectErr: true},
22 filepath.FromSlash(`NewSuperHeroMovie-2019-English-720p.avi /../../../../../Roaming/Microsoft/Windows/Start Menu/Programs/Startup/test3.exe`)},
26 actual, err := ToSafeFilePath(_case.input...)
31 t.Errorf("%q: expected error, got output %q", _case.input, actual)