(t *testing.T)
| 1496 | } |
| 1497 | |
| 1498 | func TestKnownRevsForCheckChangeVersion(t *testing.T) { |
| 1499 | |
| 1500 | db, ctx := setupTestDB(t) |
| 1501 | defer db.Close(ctx) |
| 1502 | collection, ctx := GetSingleDatabaseCollectionWithUser(ctx, t, db) |
| 1503 | |
| 1504 | // have three revisions on db for the doc |
| 1505 | revID, doc, err := collection.Put(ctx, t.Name(), Body{"some": "data"}) |
| 1506 | require.NoError(t, err) |
| 1507 | for i := 0; i < 2; i++ { |
| 1508 | revID, doc, err = collection.Put(ctx, t.Name(), Body{"some": "data", BodyRev: revID}) |
| 1509 | require.NoError(t, err) |
| 1510 | } |
| 1511 | |
| 1512 | // call CheckChangeVersion with fake VV and the docID from above |
| 1513 | missing, possible := collection.CheckChangeVersion(ctx, t.Name(), "123@src") |
| 1514 | |
| 1515 | // assert that the missing revision is the CV and known revID is current revIDS of the document |
| 1516 | require.Len(t, missing, 1) |
| 1517 | require.Len(t, possible, 2) |
| 1518 | // db's CV and revID of the doc should be returned as known revs by CheckChangeVersion |
| 1519 | assert.Equal(t, "123@src", missing[0]) |
| 1520 | assert.Equal(t, doc.HLV.GetCurrentVersionString(), possible[0]) |
| 1521 | assert.Equal(t, doc.GetRevTreeID(), possible[1]) |
| 1522 | } |
| 1523 | |
| 1524 | func TestPutStampClusterUUID(t *testing.T) { |
| 1525 | if base.UnitTestUrlIsWalrus() || !base.TestUseXattrs() { |
nothing calls this directly
no test coverage detected