DocMetadataFromDocVersion returns metadata DocVersion from the given document and version.
(t testing.TB, docID string, hlv *db.HybridLogicalVector, version rest.DocVersion)
| 84 | |
| 85 | // DocMetadataFromDocVersion returns metadata DocVersion from the given document and version. |
| 86 | func DocMetadataFromDocVersion(t testing.TB, docID string, hlv *db.HybridLogicalVector, version rest.DocVersion) DocMetadata { |
| 87 | m := DocMetadata{ |
| 88 | DocID: docID, |
| 89 | RevTreeID: version.RevTreeID, |
| 90 | ImplicitHLV: hlv, |
| 91 | } |
| 92 | if hlv != nil { |
| 93 | m.HLV = hlv |
| 94 | } else { |
| 95 | m.HLV = db.NewHybridLogicalVector() |
| 96 | require.NoError(t, m.HLV.AddVersion(version.CV)) |
| 97 | } |
| 98 | return m |
| 99 | } |
| 100 | |
| 101 | // assertHLVEqual asserts that the HLV of the version is equal to the expected HLV. |
| 102 | func assertHLVEqual(t assert.TestingT, dsName sgbucket.DataStoreName, docID string, p string, version DocMetadata, body []byte, expected DocMetadata, topology Topology) { |
no test coverage detected