1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-24 08:02:33 +03:00

for valid filename tests

This commit is contained in:
Zack 2024-05-30 15:21:51 -07:00
parent fbf1eeedce
commit 9246408278

View File

@ -253,6 +253,10 @@ func TestIsLocalIP(t *testing.T) {
func TestValidFileName(t *testing.T) { func TestValidFileName(t *testing.T) {
// contains regular characters // contains regular characters
assert.True(t, ValidFileName("中文.csl")) assert.True(t, ValidFileName("中文.csl"))
// contains regular characters
assert.True(t, ValidFileName("[something].csl"))
// contains regular characters
assert.True(t, ValidFileName("[(something)].csl"))
// contains invisible character // contains invisible character
assert.False(t, ValidFileName("D中文.cslouglas")) assert.False(t, ValidFileName("D中文.cslouglas"))
} }