TEST(GTestStringBuffer, TestData) { StringBuffer::Ptr sb = StringBuffer::create(); sb->appendChar('a'); sb->appendChar('1'); sb->appendStr(sb->data()); ASSERT_TRUE(sb->toString()->equals(String::create("a1a1"))); }
TEST(GTestStringBuffer, TestAppendChar) { StringBuffer::Ptr sb = StringBuffer::create(); ASSERT_EQ(sb, sb->appendChar('a')); ASSERT_EQ(sb, sb->appendChar('1')); ASSERT_TRUE(sb->toString()->equals(String::create("a1"))); }