From 360f89e72aa6281a9ea4da362349001c81c6e96a Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Thu, 12 Oct 2023 15:15:44 -0400 Subject: [PATCH] WIP --- mongo/integration/unified_spec_test.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/mongo/integration/unified_spec_test.go b/mongo/integration/unified_spec_test.go index c12df5f6ea..7689b614ec 100644 --- a/mongo/integration/unified_spec_test.go +++ b/mongo/integration/unified_spec_test.go @@ -162,7 +162,19 @@ type expectation struct { } type outcome struct { - Collection *outcomeCollection `bson:"collection"` + Collection *outcomeCollection + CollectionData []*collectionData +} + +func (outcome *outcome) UnmarshalBSON(b []byte) error { + var v struct { + Collection *outcomeCollection `bson:"collection"` + } + err := bson.UnmarshalWithRegistry(specTestRegistry, b, &v) + if err == nil { + outcome.Collection = v.Collection + } + return err } type outcomeCollection struct { @@ -170,6 +182,12 @@ type outcomeCollection struct { Data interface{} `bson:"data"` } +type collectionData struct { + DatabaseName string `bson:"databaseName"` + CollectionName string `bson:"collectionName"` + Documents []bson.Raw `bson:"documents"` +} + type operationError struct { ErrorContains *string `bson:"errorContains"` ErrorCodeName *string `bson:"errorCodeName"`