diff options
author | James Wahlin <james@mongodb.com> | 2020-12-02 12:47:59 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-12-03 01:07:31 +0000 |
commit | 46ed0d855de5174ba5bddbc17acc8c4eab32e881 (patch) | |
tree | a2eed73b855b8163d16538fb65cb768fe4fcb497 /src/mongo/db/matcher/path_accepting_keyword_test.cpp | |
parent | c602b82432c4a4413b5cfad2ca88f7d0294c92eb (diff) | |
download | mongo-46ed0d855de5174ba5bddbc17acc8c4eab32e881.tar.gz |
SERVER-53007 Add $eq support to queryOperatorMap
Diffstat (limited to 'src/mongo/db/matcher/path_accepting_keyword_test.cpp')
-rw-r--r-- | src/mongo/db/matcher/path_accepting_keyword_test.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/mongo/db/matcher/path_accepting_keyword_test.cpp b/src/mongo/db/matcher/path_accepting_keyword_test.cpp index 52b42e5d959..95a260fea4a 100644 --- a/src/mongo/db/matcher/path_accepting_keyword_test.cpp +++ b/src/mongo/db/matcher/path_accepting_keyword_test.cpp @@ -121,16 +121,8 @@ TEST(PathAcceptingKeyword, CanParseKnownMatchTypes) { ASSERT_TRUE(PathAcceptingKeyword::INTERNAL_EXPR_EQ == MatchExpressionParser::parsePathAcceptingKeyword( BSON("$_internalExprEq" << 1).firstElement())); -} - -TEST(PathAcceptingKeyword, EqualityMatchReturnsDefault) { - // 'boost::none' is the default when none specified. - ASSERT_TRUE(boost::none == + ASSERT_TRUE(PathAcceptingKeyword::EQUALITY == MatchExpressionParser::parsePathAcceptingKeyword(BSON("$eq" << 1).firstElement())); - // Should return default specified by caller. - ASSERT_TRUE(PathAcceptingKeyword::GEO_NEAR == - MatchExpressionParser::parsePathAcceptingKeyword(BSON("$eq" << 1).firstElement(), - PathAcceptingKeyword::GEO_NEAR)); } TEST(PathAcceptingKeyword, UnknownExpressionReturnsDefault) { @@ -142,6 +134,10 @@ TEST(PathAcceptingKeyword, UnknownExpressionReturnsDefault) { ASSERT_TRUE(PathAcceptingKeyword::NOT_IN == MatchExpressionParser::parsePathAcceptingKeyword(BSON("size" << 1).firstElement(), PathAcceptingKeyword::NOT_IN)); + // 'boost::none' is the default when none specified. + ASSERT_TRUE(boost::none == + MatchExpressionParser::parsePathAcceptingKeyword( + BSON("NonExistentKeyWord" << 1).firstElement())); } TEST(PathAcceptingKeyword, EmptyBSONElemReturnsDefault) { |