Add tests for Writer API for RAPIDJSON_HAS_STDSTRING

This commit is contained in:
miloyip
2015-04-13 14:25:05 +08:00
parent 3d82781a75
commit 3c028685df
4 changed files with 22 additions and 2 deletions

View File

@@ -89,6 +89,15 @@ TEST(Writer, String) {
TEST_ROUNDTRIP("[\"Hello\"]");
TEST_ROUNDTRIP("[\"Hello\\u0000World\"]");
TEST_ROUNDTRIP("[\"\\\"\\\\/\\b\\f\\n\\r\\t\"]");
#if RAPIDJSON_HAS_STDSTRING
{
StringBuffer buffer;
Writer<StringBuffer> writer(buffer);
writer.String(std::string("Hello\n"));
EXPECT_STREQ("\"Hello\\n\"", buffer.GetString());
}
#endif
}
TEST(Writer, Double) {