diff options
author | Gabriel Russell <gabriel.russell@mongodb.com> | 2015-08-11 10:55:45 -0400 |
---|---|---|
committer | Gabriel Russell <gabriel.russell@mongodb.com> | 2015-08-11 11:33:23 -0400 |
commit | db593fe5ee1a6e64ab4fba678e0bf00f517ae2c7 (patch) | |
tree | 2b10829fe036f745b8c719c82184b4912d20634c | |
parent | f578d5d79df9884e654f72a8461e8b06451e42ce (diff) | |
download | mongo-db593fe5ee1a6e64ab4fba678e0bf00f517ae2c7.tar.gz |
TOOLS-870 fix mongooplog tests for ordered oplog fields
-rw-r--r-- | mongooplog/mongooplog_test.go | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/mongooplog/mongooplog_test.go b/mongooplog/mongooplog_test.go index f9b4a335cdc..6a161e1cb06 100644 --- a/mongooplog/mongooplog_test.go +++ b/mongooplog/mongooplog_test.go @@ -5,8 +5,8 @@ import ( "github.com/mongodb/mongo-tools/common/options" "github.com/mongodb/mongo-tools/common/testutil" . "github.com/smartystreets/goconvey/convey" - "gopkg.in/mgo.v2/bson" "gopkg.in/mgo.v2" + "gopkg.in/mgo.v2/bson" "testing" ) @@ -68,7 +68,6 @@ func TestBasicOps(t *testing.T) { // create the collection we are testing against (ignore errors) sess.DB("mongooplog_test").C("data").Create(&mgo.CollectionInfo{}) - // clear out the collection we'll use for testing testColl := sess.DB("mongooplog_test").C("data") @@ -82,8 +81,10 @@ func TestBasicOps(t *testing.T) { Version: 2, Operation: "i", Namespace: "mongooplog_test.data", - Object: bson.M{ - "_id": 3, + Object: bson.D{ + bson.DocElem{ + "_id", 3, + }, }, } So(oplogColl.Insert(op1), ShouldBeNil) @@ -93,8 +94,10 @@ func TestBasicOps(t *testing.T) { Version: 2, Operation: "i", Namespace: "mongooplog_test.data", - Object: bson.M{ - "_id": 4, + Object: bson.D{ + bson.DocElem{ + "_id", 4, + }, }, } So(oplogColl.Insert(op2), ShouldBeNil) @@ -107,8 +110,10 @@ func TestBasicOps(t *testing.T) { Version: 2, Operation: "i", Namespace: "mongooplog_test.data", - Object: bson.M{ - "_id": 3, + Object: bson.D{ + bson.DocElem{ + "_id", 3, + }, }, } So(oplogColl.Insert(op3), ShouldBeNil) |