summaryrefslogtreecommitdiff
path: root/src/mongo/idl
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2017-12-01 11:05:23 -0500
committerMark Benvenuto <mark.benvenuto@mongodb.com>2017-12-01 11:05:23 -0500
commit671dd2c46fb49aabd969781b3c8c90cb109a1032 (patch)
tree77b2084a0a2fed1872dbde61a0524b1c88d28b80 /src/mongo/idl
parent26279e86956158edf69e8ed4e82cc211bf90ede4 (diff)
downloadmongo-671dd2c46fb49aabd969781b3c8c90cb109a1032.tar.gz
SERVER-31660 Bring BSONObj parsers back for IDL generated commands
Diffstat (limited to 'src/mongo/idl')
-rw-r--r--src/mongo/idl/idl_test.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mongo/idl/idl_test.cpp b/src/mongo/idl/idl_test.cpp
index 1d3ac995b47..9f26f03633f 100644
--- a/src/mongo/idl/idl_test.cpp
+++ b/src/mongo/idl/idl_test.cpp
@@ -2027,9 +2027,20 @@ TEST(IDLDocSequence, TestWellKnownFieldsAreIgnored) {
<< "objects"
<< BSON_ARRAY(BSON("foo" << 1)));
+
OpMsgRequest request = OpMsgRequest::fromDBAndBody("db", testTempDoc);
- auto testStruct = DocSequenceCommand::parse(ctxt, request);
- ASSERT_EQUALS(2UL, testStruct.getStructs().size());
+
+ // Validate it can be parsed as a OpMsgRequest.
+ {
+ auto testStruct = DocSequenceCommand::parse(ctxt, request);
+ ASSERT_EQUALS(2UL, testStruct.getStructs().size());
+ }
+
+ // Validate it can be parsed as just a BSON document.
+ {
+ auto testStruct = DocSequenceCommand::parse(ctxt, request.body);
+ ASSERT_EQUALS(2UL, testStruct.getStructs().size());
+ }
}
}