File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1527,6 +1527,17 @@ JSONTEST_FIXTURE(WriterTest, dropNullPlaceholders) {
1527
1527
JSONTEST_ASSERT (writer.write (nullValue) == " \n " );
1528
1528
}
1529
1529
1530
+ struct StreamWriterTest : JsonTest::TestCase {};
1531
+
1532
+ JSONTEST_FIXTURE (StreamWriterTest, dropNullPlaceholders) {
1533
+ Json::StreamWriterBuilder b;
1534
+ Json::Value nullValue;
1535
+ b.settings_ [" dropNullPlaceholders" ] = false ;
1536
+ JSONTEST_ASSERT (Json::writeString (b, nullValue) == " null" );
1537
+ b.settings_ [" dropNullPlaceholders" ] = true ;
1538
+ JSONTEST_ASSERT (Json::writeString (b, nullValue) == " " );
1539
+ }
1540
+
1530
1541
struct ReaderTest : JsonTest::TestCase {};
1531
1542
1532
1543
JSONTEST_FIXTURE (ReaderTest, parseWithNoErrors) {
@@ -1740,6 +1751,7 @@ int main(int argc, const char* argv[]) {
1740
1751
JSONTEST_REGISTER_FIXTURE (runner, CharReaderTest, parseWithDetailError);
1741
1752
1742
1753
JSONTEST_REGISTER_FIXTURE (runner, WriterTest, dropNullPlaceholders);
1754
+ JSONTEST_REGISTER_FIXTURE (runner, StreamWriterTest, dropNullPlaceholders);
1743
1755
1744
1756
return runner.runCommandLine (argc, argv);
1745
1757
}
You can’t perform that action at this time.
0 commit comments