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

Add empty data logic

This commit is contained in:
mcrakhman 2024-07-05 13:24:56 +02:00
parent ec87ee56de
commit bdb7cf3aca
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
4 changed files with 69 additions and 43 deletions

View file

@ -852,15 +852,6 @@ func TestObjectTree(t *testing.T) {
require.Equal(t, []string{"6"}, objTree.Heads())
require.Equal(t, 6, len(res.Added))
// checking that added changes still have data
for _, ch := range res.Added {
unmarshallRaw := &treechangeproto.RawTreeChange{}
proto.Unmarshal(ch.RawChange, unmarshallRaw)
treeCh := &treechangeproto.TreeChange{}
proto.Unmarshal(unmarshallRaw.Payload, treeCh)
require.Equal(t, ch.Id, string(treeCh.ChangesData))
}
// checking that the tree doesn't have data in memory
err = objTree.IterateRoot(nil, func(change *Change) bool {
if change.Id == "0" {