From 3893e7ff97d576652756456fafba2936092e15ce Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Wed, 8 May 2013 10:26:44 -0400 Subject: SERVER-6400 Use an abstraction layer into MatchExpression for different formats currently BSONObj vs index keys --- src/mongo/db/matcher/expression_parser_test.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mongo/db/matcher/expression_parser_test.cpp') diff --git a/src/mongo/db/matcher/expression_parser_test.cpp b/src/mongo/db/matcher/expression_parser_test.cpp index 12d9ce553c2..28e53aef3a7 100644 --- a/src/mongo/db/matcher/expression_parser_test.cpp +++ b/src/mongo/db/matcher/expression_parser_test.cpp @@ -32,8 +32,8 @@ namespace mongo { StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - ASSERT( result.getValue()->matches( BSON( "x" << 2 ) ) ); - ASSERT( !result.getValue()->matches( BSON( "x" << 3 ) ) ); + ASSERT( result.getValue()->matchesBSON( BSON( "x" << 2 ) ) ); + ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 3 ) ) ); } TEST( MatchExpressionParserTest, Multiple1 ) { @@ -41,11 +41,11 @@ namespace mongo { StatusWithMatchExpression result = MatchExpressionParser::parse( query ); ASSERT_TRUE( result.isOK() ); - ASSERT( result.getValue()->matches( BSON( "x" << 5 << "y" << 7 ) ) ); - ASSERT( result.getValue()->matches( BSON( "x" << 5 << "y" << 6 ) ) ); - ASSERT( !result.getValue()->matches( BSON( "x" << 6 << "y" << 7 ) ) ); - ASSERT( !result.getValue()->matches( BSON( "x" << 5 << "y" << 9 ) ) ); - ASSERT( !result.getValue()->matches( BSON( "x" << 5 << "y" << 4 ) ) ); + ASSERT( result.getValue()->matchesBSON( BSON( "x" << 5 << "y" << 7 ) ) ); + ASSERT( result.getValue()->matchesBSON( BSON( "x" << 5 << "y" << 6 ) ) ); + ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 6 << "y" << 7 ) ) ); + ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 5 << "y" << 9 ) ) ); + ASSERT( !result.getValue()->matchesBSON( BSON( "x" << 5 << "y" << 4 ) ) ); } TEST( AtomicMatchExpressionTest, Simple1 ) { -- cgit v1.2.1