mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 05:11:06 +02:00
fix tests
This commit is contained in:
parent
ce3c65ef1d
commit
e439b65daa
1 changed files with 3 additions and 2 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -260,7 +261,7 @@ func TestValidFileName(t *testing.T) {
|
||||||
// contains invisible character
|
// contains invisible character
|
||||||
err := ValidFileName("D中文.cslouglas")
|
err := ValidFileName("D中文.cslouglas")
|
||||||
assert.NotNil(t, err)
|
assert.NotNil(t, err)
|
||||||
assert.Equal(t, "non-graphical unicode: e2808b U+8203 in 'D中文.cslouglas'", err.Error())
|
assert.Equal(t, "non-graphical unicode: e2808b U+8203 in '44e4b8ade696872e63736c6f75676c6173e2808b'", err.Error())
|
||||||
assert.NotNil(t, ValidFileName("hi..txt"))
|
assert.NotNil(t, ValidFileName("hi..txt"))
|
||||||
assert.NotNil(t, ValidFileName("/hi/something.txt"))
|
assert.NotNil(t, ValidFileName(path.Join(string(os.PathSeparator), "abs", string(os.PathSeparator), "hi.txt")))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue