summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_set_test.cpp
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2014-08-07 17:39:57 -0400
committerJason Rassi <rassi@10gen.com>2014-08-07 17:39:57 -0400
commit3e570fc232d1e678324b80e803dabba2e41da9a0 (patch)
tree4ede47eca7d73a2cdaeb80f9e0f7445f90396b35 /src/mongo/db/index_set_test.cpp
parent1fbb52159eb9748627ffd2ae16785ad807d3ebb1 (diff)
downloadmongo-3e570fc232d1e678324b80e803dabba2e41da9a0.tar.gz
SERVER-14738 Correctly determine if update w/ text index is in-place
(backport of 1f00ffcd22e671f5adeece53c68b5e462ba01ec0)
Diffstat (limited to 'src/mongo/db/index_set_test.cpp')
-rw-r--r--src/mongo/db/index_set_test.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mongo/db/index_set_test.cpp b/src/mongo/db/index_set_test.cpp
index 28a1d9fe68e..19835fd7fa4 100644
--- a/src/mongo/db/index_set_test.cpp
+++ b/src/mongo/db/index_set_test.cpp
@@ -31,12 +31,37 @@ namespace mongo {
ASSERT_FALSE( a.mightBeIndexed( "b" ) );
ASSERT_FALSE( a.mightBeIndexed( "a.c" ) );
+
+ a.clear();
+ ASSERT_FALSE( a.mightBeIndexed( "a.b" ) );
}
TEST( IndexPathSetTest, Simple2 ) {
IndexPathSet a;
a.addPath( "ab" );
ASSERT_FALSE( a.mightBeIndexed( "a" ) );
+ a.clear();
+ ASSERT_FALSE( a.mightBeIndexed( "ab" ) );
+ }
+
+ TEST( IndexPathSetTest, AllPathsIndexed1 ) {
+ IndexPathSet a;
+ a.allPathsIndexed();
+ ASSERT_TRUE( a.mightBeIndexed( "a" ) );
+ a.clear();
+ ASSERT_FALSE( a.mightBeIndexed( "a" ) );
+ }
+
+ TEST( IndexPathSetTest, AllPathsIndexed2 ) {
+ IndexPathSet a;
+ a.allPathsIndexed();
+ ASSERT_TRUE( a.mightBeIndexed( "a" ) );
+ ASSERT_TRUE( a.mightBeIndexed( "" ) );
+ a.addPath( "a" );
+ ASSERT_TRUE( a.mightBeIndexed( "a" ) );
+ ASSERT_TRUE( a.mightBeIndexed( "b" ) );
+ a.clear();
+ ASSERT_FALSE( a.mightBeIndexed( "a" ) );
}