Skip to content

Commit 84a0356

Browse files
committed
Add unit test for Issue 889
1 parent 33a9f58 commit 84a0356

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/unittest/writertest.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ TEST(Writer, String) {
100100
#endif
101101
}
102102

103+
TEST(Writer, Issue_889) {
104+
char buf[100] = "Hello";
105+
106+
StringBuffer buffer;
107+
Writer<StringBuffer> writer(buffer);
108+
writer.StartArray();
109+
writer.String(buf);
110+
writer.EndArray();
111+
112+
EXPECT_STREQ("[\"Hello\"]", buffer.GetString());
113+
EXPECT_TRUE(writer.IsComplete()); \
114+
}
115+
103116
TEST(Writer, ScanWriteUnescapedString) {
104117
const char json[] = "[\" \\\"0123456789ABCDEF\"]";
105118
// ^ scanning stops here.

0 commit comments

Comments
 (0)