1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Copy data in load iterator

This commit is contained in:
mcrakhman 2024-11-25 16:53:13 +01:00
parent 825878ae4d
commit 305205a8ba
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
4 changed files with 13 additions and 8 deletions

View file

@ -786,7 +786,8 @@ func TestObjectTree(t *testing.T) {
for _, ch := range rawChanges {
raw, err := treeStorage.Get(context.Background(), ch.Id)
assert.NoError(t, err, "storage should have all the changes")
assert.Equal(t, ch, raw, "the changes in the storage should be the same")
assert.Equal(t, ch.Id, raw.RawTreeChangeWithId().Id, "the changes in the storage should be the same")
assert.Equal(t, ch.RawChange, raw.RawTreeChangeWithId().RawChange, "the changes in the storage should be the same")
}
})
@ -912,7 +913,8 @@ func TestObjectTree(t *testing.T) {
for _, ch := range rawChanges {
raw, err := treeStorage.Get(context.Background(), ch.Id)
assert.NoError(t, err, "storage should have all the changes")
assert.Equal(t, ch, raw, "the changes in the storage should be the same")
assert.Equal(t, ch.Id, raw.RawTreeChangeWithId().Id, "the changes in the storage should be the same")
assert.Equal(t, ch.RawChange, raw.RawTreeChangeWithId().RawChange, "the changes in the storage should be the same")
}
})
@ -995,7 +997,8 @@ func TestObjectTree(t *testing.T) {
for _, ch := range rawChanges {
raw, err := treeStorage.Get(context.Background(), ch.Id)
assert.NoError(t, err, "storage should have all the changes")
assert.Equal(t, ch, raw, "the changes in the storage should be the same")
assert.Equal(t, ch.Id, raw.RawTreeChangeWithId().Id, "the changes in the storage should be the same")
assert.Equal(t, ch.RawChange, raw.RawTreeChangeWithId().RawChange, "the changes in the storage should be the same")
treeCh, err := objTree.GetChange(ch.Id)
if ch.Id == "3" || ch.Id == "4" {
require.NoError(t, err)
@ -1071,7 +1074,7 @@ func TestObjectTree(t *testing.T) {
treeCtx := prepareTreeContext(t, aclList)
changeCreator := treeCtx.changeCreator
objTree := treeCtx.objTree
store := treeCtx.treeStorage.(testStorage)
store := treeCtx.treeStorage.(*testStorage)
store.errAdd = fmt.Errorf("error saving")
rawChanges := []*treechangeproto.RawTreeChangeWithId{