Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Oct 12, 2023
1 parent 284715c commit 360f89e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion mongo/integration/unified_spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,32 @@ 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 {
Name string `bson:"name"`
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"`
Expand Down

0 comments on commit 360f89e

Please sign in to comment.