@ -185,8 +185,13 @@ var documentStoreOpsTestCases = []documentStoreOpsTestCase{
|
||||
return errors.Errorf("upsertedDoc[\"attr1\"]: expected '%v', got '%v'", e, g)
|
||||
}
|
||||
|
||||
upsertedDocRevision, _ := upsertedDoc.Revision()
|
||||
if e, g := 0, upsertedDocRevision; e != g {
|
||||
return errors.Errorf("upsertedDoc.Revision(): expected '%v', got '%v'", e, g)
|
||||
}
|
||||
|
||||
// Check that document does not have unexpected properties
|
||||
if e, g := 4, len(upsertedDoc); e != g {
|
||||
if e, g := 5, len(upsertedDoc); e != g {
|
||||
return errors.Errorf("len(upsertedDoc): expected '%v', got '%v'", e, g)
|
||||
}
|
||||
|
||||
@ -217,6 +222,11 @@ var documentStoreOpsTestCases = []documentStoreOpsTestCase{
|
||||
return errors.New("upsertedDoc2.UpdatedAt() should have been different than upsertedDoc.UpdatedAt()")
|
||||
}
|
||||
|
||||
upsertedDoc2Revision, _ := upsertedDoc2.Revision()
|
||||
if e, g := 1, upsertedDoc2Revision; e != g {
|
||||
return errors.Errorf("upsertedDoc.Revision(): expected '%v', got '%v'", e, g)
|
||||
}
|
||||
|
||||
// Verify that there is no additional created document in the collection
|
||||
|
||||
results, err := store.Query(ctx, collection, nil)
|
||||
@ -228,6 +238,11 @@ var documentStoreOpsTestCases = []documentStoreOpsTestCase{
|
||||
return errors.Errorf("len(results): expected '%v', got '%v'", e, g)
|
||||
}
|
||||
|
||||
firstResultRevision, _ := results[0].Revision()
|
||||
if e, g := 1, firstResultRevision; e != g {
|
||||
return errors.Errorf("results[0].Revision(): expected '%v', got '%v'", e, g)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
},
|
||||
@ -437,7 +452,6 @@ func testDocumentStoreOps(ctx context.Context, t *testing.T, store storage.Docum
|
||||
for _, tc := range documentStoreOpsTestCases {
|
||||
func(tc documentStoreOpsTestCase) {
|
||||
t.Run(tc.Name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
if err := tc.Run(ctx, store); err != nil {
|
||||
t.Errorf("%+v", errors.WithStack(err))
|
||||
}
|
||||
|
Reference in New Issue
Block a user