mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-28 03:20:15 +01:00
Add tests for Writer API for RAPIDJSON_HAS_STDSTRING
This commit is contained in:
@@ -79,3 +79,14 @@ TEST(PrettyWriter, SetIndent) {
|
||||
"}",
|
||||
buffer.GetString());
|
||||
}
|
||||
|
||||
#if RAPIDJSON_HAS_STDSTRING
|
||||
TEST(PrettyWriter, String_STDSTRING) {
|
||||
StringBuffer buffer;
|
||||
PrettyWriter<StringBuffer> writer(buffer);
|
||||
EXPECT_TRUE(writer.StartArray());
|
||||
EXPECT_TRUE(writer.String(std::string("Hello\n")));
|
||||
EXPECT_TRUE(writer.EndArray());
|
||||
EXPECT_STREQ("[\n \"Hello\\n\"\n]", buffer.GetString());
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user