apply local Syncthing patches for v2.1.0
This commit is contained in:
@@ -60,15 +60,15 @@ func TestRecvOnlyRevertDeletes(t *testing.T) {
|
||||
|
||||
must(t, m.ScanFolder("ro"))
|
||||
|
||||
// We should now have two files and two directories, with global state unchanged.
|
||||
// We should now have three files and two directories, with global state unchanged.
|
||||
|
||||
size = mustV(m.GlobalSize("ro"))
|
||||
if size.Files != 1 || size.Directories != 1 {
|
||||
t.Fatalf("Global: expected 1 file and 1 directory: %+v", size)
|
||||
}
|
||||
size = mustV(m.LocalSize("ro", protocol.LocalDeviceID))
|
||||
if size.Files != 2 || size.Directories != 2 {
|
||||
t.Fatalf("Local: expected 2 files and 2 directories: %+v", size)
|
||||
if size.Files != 3 || size.Directories != 2 {
|
||||
t.Fatalf("Local: expected 3 files and 2 directories: %+v", size)
|
||||
}
|
||||
size = mustV(m.ReceiveOnlySize("ro"))
|
||||
if size.Files+size.Directories == 0 {
|
||||
|
||||
@@ -974,13 +974,15 @@ func TestIgnoreDeleteUnignore(t *testing.T) {
|
||||
file := "foobar"
|
||||
contents := []byte("test file contents\n")
|
||||
|
||||
basicCheck := func(fs []protocol.FileInfo) {
|
||||
basicCheck := func(fs []protocol.FileInfo) protocol.FileInfo {
|
||||
t.Helper()
|
||||
if len(fs) != 1 {
|
||||
t.Fatal("expected a single index entry, got", len(fs))
|
||||
} else if fs[0].Name != file {
|
||||
t.Fatalf("expected a index entry for %v, got one for %v", file, fs[0].Name)
|
||||
for _, f := range fs {
|
||||
if f.Name == file {
|
||||
return f
|
||||
}
|
||||
}
|
||||
t.Fatalf("expected an index entry for %v, got %v", file, fs)
|
||||
return protocol.FileInfo{}
|
||||
}
|
||||
|
||||
done := make(chan struct{})
|
||||
@@ -1001,8 +1003,7 @@ func TestIgnoreDeleteUnignore(t *testing.T) {
|
||||
|
||||
done = make(chan struct{})
|
||||
fc.setIndexFn(func(_ context.Context, folder string, fs []protocol.FileInfo) error {
|
||||
basicCheck(fs)
|
||||
f := fs[0]
|
||||
f := basicCheck(fs)
|
||||
if !f.IsInvalid() {
|
||||
t.Errorf("Received non-invalid index update")
|
||||
}
|
||||
@@ -1022,8 +1023,7 @@ func TestIgnoreDeleteUnignore(t *testing.T) {
|
||||
|
||||
done = make(chan struct{})
|
||||
fc.setIndexFn(func(_ context.Context, folder string, fs []protocol.FileInfo) error {
|
||||
basicCheck(fs)
|
||||
f := fs[0]
|
||||
f := basicCheck(fs)
|
||||
if f.IsInvalid() {
|
||||
t.Errorf("Received invalid index update")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user