summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher/expression_test.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2013-05-06 11:22:54 -0400
committerEliot Horowitz <eliot@10gen.com>2013-05-06 11:22:54 -0400
commited3efe444510137cc45e11188e23680656e22ead (patch)
treedc1d75a66e0f7bb1112adccde2994957845a6f76 /src/mongo/db/matcher/expression_test.cpp
parentd6a2d8027f1cbc684d960b8f522e3ffb4043d6d2 (diff)
downloadmongo-ed3efe444510137cc45e11188e23680656e22ead.tar.gz
SERVER-6400: MatchExpression version of Matcher code complete.
Diffstat (limited to 'src/mongo/db/matcher/expression_test.cpp')
-rw-r--r--src/mongo/db/matcher/expression_test.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/db/matcher/expression_test.cpp b/src/mongo/db/matcher/expression_test.cpp
index 93c1d20af2a..81ab018fbfb 100644
--- a/src/mongo/db/matcher/expression_test.cpp
+++ b/src/mongo/db/matcher/expression_test.cpp
@@ -35,8 +35,8 @@ namespace mongo {
TEST( LeafMatchExpressionTest, Equal1 ) {
BSONObj temp = BSON( "x" << 5 );
- ComparisonMatchExpression e;
- e.init( "x", ComparisonMatchExpression::EQ, temp["x"] );
+ EqualityMatchExpression e;
+ e.init( "x", temp["x"] );
ASSERT_TRUE( e.matches( fromjson( "{ x : 5 }" ) ) );
ASSERT_TRUE( e.matches( fromjson( "{ x : [5] }" ) ) );
@@ -54,8 +54,8 @@ namespace mongo {
BSONObj temp = BSON( "x" << 5 );
{
- ComparisonMatchExpression e;
- e.init( "x", ComparisonMatchExpression::LTE, temp["x"] );
+ LTEMatchExpression e;
+ e.init( "x", temp["x"] );
ASSERT_TRUE( e.matches( fromjson( "{ x : 5 }" ) ) );
ASSERT_TRUE( e.matches( fromjson( "{ x : 4 }" ) ) );
ASSERT_FALSE( e.matches( fromjson( "{ x : 6 }" ) ) );
@@ -63,8 +63,8 @@ namespace mongo {
}
{
- ComparisonMatchExpression e;
- e.init( "x", ComparisonMatchExpression::LT, temp["x"] );
+ LTMatchExpression e;
+ e.init( "x", temp["x"] );
ASSERT_FALSE( e.matches( fromjson( "{ x : 5 }" ) ) );
ASSERT_TRUE( e.matches( fromjson( "{ x : 4 }" ) ) );
ASSERT_FALSE( e.matches( fromjson( "{ x : 6 }" ) ) );
@@ -72,8 +72,8 @@ namespace mongo {
}
{
- ComparisonMatchExpression e;
- e.init( "x", ComparisonMatchExpression::GTE, temp["x"] );
+ GTEMatchExpression e;
+ e.init( "x", temp["x"] );
ASSERT_TRUE( e.matches( fromjson( "{ x : 5 }" ) ) );
ASSERT_FALSE( e.matches( fromjson( "{ x : 4 }" ) ) );
ASSERT_TRUE( e.matches( fromjson( "{ x : 6 }" ) ) );
@@ -81,8 +81,8 @@ namespace mongo {
}
{
- ComparisonMatchExpression e;
- e.init( "x", ComparisonMatchExpression::GT, temp["x"] );
+ GTMatchExpression e;
+ e.init( "x", temp["x"] );
ASSERT_FALSE( e.matches( fromjson( "{ x : 5 }" ) ) );
ASSERT_FALSE( e.matches( fromjson( "{ x : 4 }" ) ) );
ASSERT_TRUE( e.matches( fromjson( "{ x : 6 }" ) ) );