summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/expression_javascript_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/expression_javascript_test.cpp')
-rw-r--r--src/mongo/db/pipeline/expression_javascript_test.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/expression_javascript_test.cpp b/src/mongo/db/pipeline/expression_javascript_test.cpp
index 51a8be82a20..d6cdf887071 100644
--- a/src/mongo/db/pipeline/expression_javascript_test.cpp
+++ b/src/mongo/db/pipeline/expression_javascript_test.cpp
@@ -164,8 +164,10 @@ TEST_F(MapReduceFixture, ExpressionFunctionFailsIfBodyNotSpecified) {
}
TEST_F(MapReduceFixture, ExpressionFunctionFailsIfBodyIsNotConstantExpression) {
- auto bsonExpr = BSON("expr" << BSON("body" << BSONObj() << "args" << BSON_ARRAY(1 << 2)
- << "lang" << ExpressionFunction::kJavaScript));
+ auto bsonExpr = BSON("expr" << BSON("body"
+ << "$a"
+ << "args" << BSON_ARRAY(1 << 2) << "lang"
+ << ExpressionFunction::kJavaScript));
ASSERT_THROWS_CODE(ExpressionFunction::parse(getExpCtxRaw(), bsonExpr.firstElement(), getVPS()),
AssertionException,
31432);