mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-27 11:06:53 +01:00
Add ShrinkToFit() to StringBuffer and MemoryBuffer
This commit is contained in:
@@ -31,6 +31,7 @@ TEST(Writer, Compact) {
|
||||
StringStream s("{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] } ");
|
||||
StringBuffer buffer;
|
||||
Writer<StringBuffer> writer(buffer);
|
||||
buffer.ShrinkToFit();
|
||||
Reader reader;
|
||||
reader.Parse<0>(s, writer);
|
||||
EXPECT_STREQ("{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3]}", buffer.GetString());
|
||||
|
||||
Reference in New Issue
Block a user