TEST( UpdateIndexDataTest, AllPathsIndexed1 ) { UpdateIndexData a; a.allPathsIndexed(); ASSERT_TRUE( a.mightBeIndexed( "a" ) ); a.clear(); ASSERT_FALSE( a.mightBeIndexed( "a" ) ); }
TEST( UpdateIndexDataTest, Simple2 ) { UpdateIndexData a; a.addPath( "ab" ); ASSERT_FALSE( a.mightBeIndexed( "a" ) ); a.clear(); ASSERT_FALSE( a.mightBeIndexed( "ab" ) ); }
TEST( UpdateIndexDataTest, AllPathsIndexed2 ) { UpdateIndexData a; a.allPathsIndexed(); ASSERT_TRUE( a.mightBeIndexed( "a" ) ); ASSERT_TRUE( a.mightBeIndexed( "" ) ); a.addPathComponent( "a" ); ASSERT_TRUE( a.mightBeIndexed( "a" ) ); ASSERT_TRUE( a.mightBeIndexed( "b" ) ); a.clear(); ASSERT_FALSE( a.mightBeIndexed( "a" ) ); }
TEST( UpdateIndexDataTest, Component1 ) { UpdateIndexData a; a.addPathComponent( "a" ); ASSERT_FALSE( a.mightBeIndexed( "" ) ); ASSERT_TRUE( a.mightBeIndexed( "a" ) ); ASSERT_TRUE( a.mightBeIndexed( "b.a" ) ); ASSERT_TRUE( a.mightBeIndexed( "a.b" ) ); ASSERT_TRUE( a.mightBeIndexed( "b.a.c" ) ); ASSERT_FALSE( a.mightBeIndexed( "b.c" ) ); ASSERT_FALSE( a.mightBeIndexed( "ab" ) ); a.clear(); ASSERT_FALSE( a.mightBeIndexed( "a" ) ); }
TEST( UpdateIndexDataTest, Simple1 ) { UpdateIndexData a; a.addPath( "a.b" ); ASSERT_TRUE( a.mightBeIndexed( "a.b" ) ); ASSERT_TRUE( a.mightBeIndexed( "a" ) ); ASSERT_TRUE( a.mightBeIndexed( "a.b.c" ) ); ASSERT_TRUE( a.mightBeIndexed( "a.$.b" ) ); ASSERT_FALSE( a.mightBeIndexed( "b" ) ); ASSERT_FALSE( a.mightBeIndexed( "a.c" ) ); a.clear(); ASSERT_FALSE( a.mightBeIndexed( "a.b" ) ); }