summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands
diff options
context:
space:
mode:
authorJacob Evans <jacob.evans@mongodb.com>2019-09-27 20:32:44 +0000
committerevergreen <evergreen@mongodb.com>2019-09-27 20:32:44 +0000
commitbe91547a55875a1823180049f86f92a8286f3ff5 (patch)
treec2f96d2d7392709e4cd3dd347ad5e3dcfdd739db /src/mongo/db/commands
parent1baa6565f72abccd2062af426b171d23af200b23 (diff)
downloadmongo-be91547a55875a1823180049f86f92a8286f3ff5.tar.gz
SERVER-42977 Remove support for CodeWScope in IDL
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r--src/mongo/db/commands/map_reduce_parse_test.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mongo/db/commands/map_reduce_parse_test.cpp b/src/mongo/db/commands/map_reduce_parse_test.cpp
index fa3533c19b3..d0bda49d84d 100644
--- a/src/mongo/db/commands/map_reduce_parse_test.cpp
+++ b/src/mongo/db/commands/map_reduce_parse_test.cpp
@@ -87,6 +87,27 @@ TEST(MapReduceParseTest, failedParse) {
DBException);
}
+TEST(MapReduceParseTest, failsToParseCodeWithScope) {
+ auto ctx = IDLParserErrorContext("mapReduce");
+
+ ASSERT_THROWS(MapReduce::parse(ctx,
+ BSON("mapReduce"
+ << "theSource"
+ << "map" << mapJavascript << "reduce"
+ << BSONCodeWScope("var x = 3", BSONObj()) << "out"
+ << BSON("inline" << 1) << "$db"
+ << "db")),
+ DBException);
+ ASSERT_THROWS(
+ MapReduce::parse(ctx,
+ BSON("mapReduce"
+ << "theSource"
+ << "map" << BSONCodeWScope("var x = 3", BSONObj()) << "reduce"
+ << reduceJavascript << "out" << BSON("inline" << 1) << "$db"
+ << "db")),
+ DBException);
+}
+
TEST(MapReduceParseTest, parseOutputTypes) {
auto ctx = IDLParserErrorContext("mapReduce");