cmd/syncthing, lib/...: Correctly handle ignores & invalid file names (fixes #3012, fixes #3457, fixes #3458)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3464
This commit is contained in:
Jakob Borg
2016-08-05 07:13:52 +00:00
committed by Audrius Butkevicius
parent a25b63e2df
commit 1eb6db6ca8
9 changed files with 151 additions and 131 deletions

View File

@@ -1,27 +0,0 @@
// Copyright (C) 2016 The Protocol Authors.
// +build windows
package protocol
import "testing"
func TestFixupFiles(t *testing.T) {
fs := []FileInfo{
{Name: "ok"}, // This file is OK
{Name: "b<d"}, // The rest should be marked as invalid
{Name: "b?d"},
{Name: "bad "},
}
fixupFiles("default", fs)
if fs[0].IsInvalid() {
t.Error("fs[0] should not be invalid")
}
for i := 1; i < len(fs); i++ {
if !fs[i].IsInvalid() {
t.Errorf("fs[%d] should be invalid", i)
}
}
}