mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
Merge pull request #1645 from AudriusButkevicius/tests
Fix tests on Windows (fixes #1531)
This commit is contained in:
commit
946d98b71f
@ -341,8 +341,8 @@ func TestWindowsPaths(t *testing.T) {
|
||||
folder.RawPath = `relative\path`
|
||||
expected = folder.RawPath
|
||||
actual = folder.Path()
|
||||
if actual != expected {
|
||||
t.Errorf("%q != %q", actual, expected)
|
||||
if actual == expected || !strings.HasPrefix(actual, "\\\\?\\") {
|
||||
t.Errorf("%q == %q, expected absolutification", actual, expected)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,9 @@ var testcases = []testcase{
|
||||
|
||||
func TestMatch(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "windows", "darwin":
|
||||
case "windows":
|
||||
testcases = append(testcases, testcase{"foo.txt", "foo.TXT", 0, true})
|
||||
case "darwin":
|
||||
testcases = append(testcases, testcase{"foo.txt", "foo.TXT", 0, true})
|
||||
fallthrough
|
||||
default:
|
||||
|
@ -78,4 +78,5 @@ func TestReadOnlyDir(t *testing.T) {
|
||||
}
|
||||
|
||||
s.fail("Test done", nil)
|
||||
s.finalClose()
|
||||
}
|
||||
|
@ -203,6 +203,14 @@ func TestNormalization(t *testing.T) {
|
||||
"5-\xCD\xE2", // EUC-CN "wài" (外) -- ignored (not UTF8)
|
||||
}
|
||||
numInvalid := 2
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
// On Windows, in case 5 the character gets replaced with a
|
||||
// replacement character \xEF\xBF\xBD at the point it's written to disk,
|
||||
// which means it suddenly becomes valid (sort of).
|
||||
numInvalid--
|
||||
}
|
||||
|
||||
numValid := len(tests) - numInvalid
|
||||
|
||||
for _, s1 := range tests {
|
||||
|
Loading…
Reference in New Issue
Block a user