1 // Copyright (C) MongoDB, Inc. 2017-present. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 // not use this file except in compliance with the License. You may obtain 5 // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 7 package bson 8 9 import ( 10 "go.mongodb.org/mongo-driver/bson/bsoncodec" 11 ) 12 13 type marshalingTestCase struct { 14 name string 15 reg *bsoncodec.Registry 16 val interface{} 17 want []byte 18 } 19 20 var marshalingTestCases = []marshalingTestCase{ 21 { 22 "small struct", 23 nil, 24 struct { 25 Foo bool 26 }{Foo: true}, 27 docToBytes(D{{"foo", true}}), 28 }, 29 } 30