mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 15:17:25 +00:00
lib/model: Fix test after version vector changes (#6607)
This commit is contained in:
parent
744ef0d8ac
commit
876609a0f0
@ -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 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)
|
||||
}
|
||||
if v := f.Version; !v.Equal(ev) {
|
||||
t.Errorf("File %v has version %v, expected %v", f.Name, v, ev)
|
||||
}
|
||||
delete(expected, f.Name)
|
||||
}
|
||||
|
BIN
lib/model/testdata/~syncthing~file.tmp
vendored
Normal file
BIN
lib/model/testdata/~syncthing~file.tmp
vendored
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user