Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiloyip <miloyip@gmail.com>2015-04-13 09:25:05 +0300
committermiloyip <miloyip@gmail.com>2015-04-13 09:25:05 +0300
commit3c028685dfdb23ba3a8c28defa857640b9c93ed1 (patch)
tree986a762f8279b0f5482b1f6839995c31cb3fec15 /test/unittest/prettywritertest.cpp
parent3d82781a7539a14fe1f04d3d94f9e37eafb1a115 (diff)
Add tests for Writer API for RAPIDJSON_HAS_STDSTRING
Diffstat (limited to 'test/unittest/prettywritertest.cpp')
-rw-r--r--test/unittest/prettywritertest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unittest/prettywritertest.cpp b/test/unittest/prettywritertest.cpp
index d0abf334..fcb11219 100644
--- a/test/unittest/prettywritertest.cpp
+++ b/test/unittest/prettywritertest.cpp
@@ -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