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

Improve tests to include check for new snapshot

This commit is contained in:
mcrakhman 2023-05-23 11:50:15 +02:00 committed by Mikhail Iudin
parent db7a95514d
commit 1343dad443
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
3 changed files with 37 additions and 37 deletions

View file

@ -41,7 +41,7 @@ var (
)
var (
doSnapshot = objecttree.DoSnapshot
DoSnapshot = objecttree.DoSnapshot
buildHistoryTree = func(objTree objecttree.ObjectTree) (objecttree.ReadableObjectTree, error) {
return objecttree.BuildHistoryTree(objecttree.HistoryTreeParams{
TreeStorage: objTree.Storage(),
@ -264,7 +264,7 @@ func (s *settingsObject) DeleteObject(id string) (err error) {
err = ErrObjDoesNotExist
return
}
isSnapshot := doSnapshot(s.Len())
isSnapshot := DoSnapshot(s.Len())
res, err := s.changeFactory.CreateObjectDeleteChange(id, s.state, isSnapshot)
if err != nil {
return

View file

@ -146,7 +146,7 @@ func TestSettingsObject_DeleteObject_NoSnapshot(t *testing.T) {
fx.init(t)
delId := "delId"
doSnapshot = func(len int) bool {
DoSnapshot = func(len int) bool {
return false
}
@ -179,7 +179,7 @@ func TestSettingsObject_DeleteObject_WithSnapshot(t *testing.T) {
fx.init(t)
delId := "delId"
doSnapshot = func(len int) bool {
DoSnapshot = func(len int) bool {
return true
}