createThenRemoveFromRevCache will create a doc and then immediately remove it from the rev cache
(t *testing.T, ctx context.Context, docID string, db *Database, collection *DatabaseCollectionWithUser)
| 1783 | |
| 1784 | // createThenRemoveFromRevCache will create a doc and then immediately remove it from the rev cache |
| 1785 | func createThenRemoveFromRevCache(t *testing.T, ctx context.Context, docID string, db *Database, collection *DatabaseCollectionWithUser) DocVersion { |
| 1786 | revIDDoc, doc, err := collection.Put(ctx, docID, Body{"test": "doc"}) |
| 1787 | require.NoError(t, err) |
| 1788 | |
| 1789 | db.revisionCache.RemoveWithRev(ctx, docID, revIDDoc, collection.GetCollectionID()) |
| 1790 | docVersion := DocVersion{ |
| 1791 | RevTreeID: doc.GetRevTreeID(), |
| 1792 | } |
| 1793 | if doc.HLV != nil { |
| 1794 | docVersion.CV = *doc.HLV.ExtractCurrentVersionFromHLV() |
| 1795 | } |
| 1796 | return docVersion |
| 1797 | } |
| 1798 | |
| 1799 | // createDocAndReturnSizeAndRev creates a rev and measures its size based on rev cache measurements |
| 1800 | func createDocAndReturnSizeAndRev(t *testing.T, ctx context.Context, docID string, collection *DatabaseCollectionWithUser, body Body) (int, string, *Version) { |
no test coverage detected