diff options
| author | Rui Liu <rui.liu@mongodb.com> | 2021-11-30 10:37:15 +0000 |
|---|---|---|
| committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-11-30 11:23:58 +0000 |
| commit | ab9802213c7afc0f88d497dee44c83ec6466435c (patch) | |
| tree | 6557a31bfe1fcfe3ceb282ab060366632ca49d12 /src/mongo/db/matcher/expression_parser_array_test.cpp | |
| parent | f84899b472bef1dbb1fd47a069f1dd77503d8c6d (diff) | |
| download | mongo-ab9802213c7afc0f88d497dee44c83ec6466435c.tar.gz | |
SERVER-61566 Fix and extract coercion to 32-bit int logic in expression parsing
Diffstat (limited to 'src/mongo/db/matcher/expression_parser_array_test.cpp')
| -rw-r--r-- | src/mongo/db/matcher/expression_parser_array_test.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/matcher/expression_parser_array_test.cpp b/src/mongo/db/matcher/expression_parser_array_test.cpp index c519ee2b374..243bed553f0 100644 --- a/src/mongo/db/matcher/expression_parser_array_test.cpp +++ b/src/mongo/db/matcher/expression_parser_array_test.cpp @@ -109,6 +109,13 @@ TEST(MatchExpressionParserArrayTest, SizeWithNegativeIntegralDouble) { ASSERT_FALSE(result.isOK()); } +TEST(MatchExpressionParserArrayTest, SizeWithTooLargeDouble) { + BSONObj query = BSON("x" << BSON("$size" << 1e12)); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + StatusWithMatchExpression result = MatchExpressionParser::parse(query, expCtx); + ASSERT_FALSE(result.isOK()); +} + TEST(MatchExpressionParserArrayTest, SizeWithDouble) { BSONObj query = BSON("x" << BSON("$size" << 2.5)); boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); |
