TEST(ng_charreach, alpha) { CharReach cr; ASSERT_EQ(0U, cr.count()); ASSERT_FALSE(cr.isAlpha()); cr.set('a'); ASSERT_FALSE(0 == cr.count()); ASSERT_TRUE(cr.isAlpha()); cr.set('A'); cr.set('b'); cr.set('z'); ASSERT_TRUE(cr.isAlpha()); cr.set(1); ASSERT_FALSE(cr.isAlpha()); }
TEST(ng_charreach, string) { CharReach cr; cr.set(1); cr.set(2); cr.set('a'); cr.set('Z'); cr.set('m'); cr.set('~'); cr.set(210); ASSERT_FALSE(cr.isAlpha()); cr.flip(1); cr.flip(2); cr.flip('~'); cr.flip(210); ASSERT_TRUE(cr.isAlpha()); ASSERT_EQ("Zam", cr.to_string()); }