lib/model: Invalidate files with trailing white space on Windows (fixes #3227)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3383
This commit is contained in:
committed by
Audrius Butkevicius
parent
fa0101bd60
commit
aa50ef4069
27
lib/protocol/nativemodel_windows_test.go
Normal file
27
lib/protocol/nativemodel_windows_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user