lib/model: Fix test after version vector changes (#6607)

This commit is contained in:
Jakob Borg 2020-05-06 21:19:33 +02:00 committed by GitHub
parent 744ef0d8ac
commit 876609a0f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -374,7 +374,6 @@ func pullInvalidIgnored(t *testing.T, ft config.FolderType) {
if f.IsInvalid() {
t.Errorf("File %v is still marked as invalid", f.Name)
}
ev := protocol.Vector{}
if f.Name == ign {
// The unignored deleted file should have an
// empty version, to make it not override
@ -382,17 +381,19 @@ func pullInvalidIgnored(t *testing.T, ft config.FolderType) {
if !f.Deleted {
t.Errorf("File %v was not marked as deleted", f.Name)
}
if len(f.Version.Counters) != 0 {
t.Errorf("File %v has version %v, expected empty", f.Name, f.Version)
}
} else {
// The unignored existing file should have a
// version with only a local counter, to make
// it conflict changed global files.
ev = protocol.Vector{}.Update(myID.Short())
if f.Deleted {
t.Errorf("File %v is marked as deleted", f.Name)
}
}
if v := f.Version; !v.Equal(ev) {
t.Errorf("File %v has version %v, expected %v", f.Name, v, ev)
if len(f.Version.Counters) != 1 || f.Version.Counter(myID.Short()) == 0 {
t.Errorf("File %v has version %v, expected one entry for ourselves", f.Name, f.Version)
}
}
delete(expected, f.Name)
}

BIN
lib/model/testdata/~syncthing~file.tmp vendored Normal file

Binary file not shown.