MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / addAndGet

Function addAndGet

db/revtree_test.go:1073–1086  ·  view source on GitHub ↗
(t *testing.T, revTree RevTree, revID string, parentRevID string, isTombstone bool)

Source from the content-addressed store, hash-verified

1071}
1072
1073func addAndGet(t *testing.T, revTree RevTree, revID string, parentRevID string, isTombstone bool) error {
1074
1075 revBody := []byte(`{"foo":"bar"}`)
1076 err := revTree.addRevision("foobar", RevInfo{
1077 ID: revID,
1078 Parent: parentRevID,
1079 Body: revBody,
1080 Deleted: isTombstone,
1081 })
1082 require.NoError(t, err)
1083 history, err := revTree.getHistory(revID)
1084 log.Printf("addAndGet. Tree length: %d. History for new rev: %v", len(revTree), history)
1085 return err
1086}
1087
1088// TestPruneRevisionsWithDisconnectedTombstones ensures that disconnected tombstoned branches are correctly pruned away. Reproduces CBG-1076.
1089func TestPruneRevisionsWithDisconnected(t *testing.T) {

Callers 1

TestRevisionPruningLoopFunction · 0.85

Calls 2

addRevisionMethod · 0.80
getHistoryMethod · 0.80

Tested by

no test coverage detected