diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-08-21 15:31:06 -0400 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-08-25 14:16:10 -0400 |
commit | b19f95495d1df437722e6a0c85ea5ca6f91cdd8b (patch) | |
tree | bbc5dd0a3b5868240cd6c5c97c48408e3170046f /src/mongo/db/matcher/expression_with_placeholder_test.cpp | |
parent | 529d5de71344fda500802fa4a8671c5745ad62fa (diff) | |
download | mongo-b19f95495d1df437722e6a0c85ea5ca6f91cdd8b.tar.gz |
SERVER-29840 Add allowed features bitmask to MatchExpressionParser::parse
Diffstat (limited to 'src/mongo/db/matcher/expression_with_placeholder_test.cpp')
-rw-r--r-- | src/mongo/db/matcher/expression_with_placeholder_test.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mongo/db/matcher/expression_with_placeholder_test.cpp b/src/mongo/db/matcher/expression_with_placeholder_test.cpp index 8fd5f4e456f..bb8abef57ef 100644 --- a/src/mongo/db/matcher/expression_with_placeholder_test.cpp +++ b/src/mongo/db/matcher/expression_with_placeholder_test.cpp @@ -30,7 +30,6 @@ #include "mongo/db/json.h" #include "mongo/db/matcher/expression_with_placeholder.h" -#include "mongo/db/matcher/extensions_callback_disallow_extensions.h" #include "mongo/db/query/collation/collator_interface_mock.h" #include "mongo/unittest/unittest.h" @@ -178,6 +177,21 @@ TEST(ExpressionWithPlaceholderTest, WhereExpressionFailsToParse) { ASSERT_NOT_OK(status.getStatus()); } +TEST(ExpressionWithPlaceholderTest, GeoNearExpressionFailsToParse) { + const CollatorInterface* collator = nullptr; + auto rawFilter = + fromjson("{i: {$nearSphere: {$geometry: {type: 'Point', coordinates: [0, 0]}}}}"); + auto status = ExpressionWithPlaceholder::parse(rawFilter, collator); + ASSERT_NOT_OK(status.getStatus()); +} + +TEST(ExpressionWithPlaceholderTest, ExprExpressionFailsToParse) { + const CollatorInterface* collator = nullptr; + auto rawFilter = fromjson("{i: {$expr: 5}}"); + auto status = ExpressionWithPlaceholder::parse(rawFilter, collator); + ASSERT_NOT_OK(status.getStatus()); +} + TEST(ExpressionWithPlaceholderTest, EquivalentIfPlaceholderAndExpressionMatch) { constexpr auto collator = nullptr; auto rawFilter1 = fromjson("{i: 5}}"); |