예제 #1
0
TEST(GTestStringBuffer, TestAppendStr3) {
    StringBuffer::Ptr sb = StringBuffer::create();
    ASSERT_EQ(sb, sb->appendStr(String::create("abc")));
    ASSERT_EQ(sb, sb->appendStr(String::null()));
    ASSERT_EQ(sb, sb->appendStr(String::create("123")));
    ASSERT_TRUE(sb->toString()->equals(String::create("abcnull123")));
}
예제 #2
0
TEST(GTestStringBuffer, TestAppendStr2) {
    StringBuffer::Ptr sb = StringBuffer::create();
    ASSERT_EQ(sb, sb->appendStr(String::create("abc")->data()));
    ASSERT_EQ(sb, sb->appendStr(static_cast<const Char*>(NULL)));
    ASSERT_EQ(sb, sb->appendStr(String::create("123")->data()));
    ASSERT_TRUE(sb->toString()->equals(String::create("abcnull123")));
}
예제 #3
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")));
}