Use CleanPath instead of path.Clean (#23371)

As title.
This commit is contained in:
Lunny Xiao authored and GitHub committed 2023-03-08 20:17:39 +08:00
1 parent 090e753923
commit b116418f05
13 files changed
+45 -28

No files matched your search

+12
View File
@@ -136,3 +136,15 @@ func TestMisc_IsReadmeFileName(t *testing.T) {
assert.Equal(t, testCase.idx, idx)
}
}
func TestCleanPath(t *testing.T) {
cases := map[string]string{
"../../test": "test",
"/test": "/test",
"/../test": "/test",
}
for k, v := range cases {
assert.Equal(t, v, CleanPath(k))
}
}