Example #1
0
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")));
}
Example #2
0
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")));
}