Improve coverage for Writer and PrettyWriter

This commit is contained in:
miloyip
2015-04-13 14:50:08 +08:00
parent 3c028685df
commit 18a8891f0d
4 changed files with 47 additions and 8 deletions

View File

@@ -80,6 +80,15 @@ TEST(PrettyWriter, SetIndent) {
buffer.GetString());
}
TEST(PrettyWriter, String) {
StringBuffer buffer;
PrettyWriter<StringBuffer> writer(buffer);
EXPECT_TRUE(writer.StartArray());
EXPECT_TRUE(writer.String("Hello\n"));
EXPECT_TRUE(writer.EndArray());
EXPECT_STREQ("[\n \"Hello\\n\"\n]", buffer.GetString());
}
#if RAPIDJSON_HAS_STDSTRING
TEST(PrettyWriter, String_STDSTRING) {
StringBuffer buffer;