File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1870,6 +1870,26 @@ JSONTEST_FIXTURE(CharReaderAllowDropNullTest, issue178) {
1870
1870
Json::Value root;
1871
1871
std::string errs;
1872
1872
Json::CharReader* reader (b.newCharReader ());
1873
+ {
1874
+ char const doc[] = " {\" a\" :,\" b\" :true}" ;
1875
+ bool ok = reader->parse (
1876
+ doc, doc + std::strlen (doc),
1877
+ &root, &errs);
1878
+ JSONTEST_ASSERT (ok);
1879
+ JSONTEST_ASSERT_STRING_EQUAL (" " , errs);
1880
+ JSONTEST_ASSERT_EQUAL (2u , root.size ());
1881
+ JSONTEST_ASSERT_EQUAL (Json::nullValue, root.get (" a" , true ));
1882
+ }
1883
+ {
1884
+ char const doc[] = " {\" a\" :}" ;
1885
+ bool ok = reader->parse (
1886
+ doc, doc + std::strlen (doc),
1887
+ &root, &errs);
1888
+ JSONTEST_ASSERT (ok);
1889
+ JSONTEST_ASSERT_STRING_EQUAL (" " , errs);
1890
+ JSONTEST_ASSERT_EQUAL (1u , root.size ());
1891
+ JSONTEST_ASSERT_EQUAL (Json::nullValue, root.get (" a" , true ));
1892
+ }
1873
1893
{
1874
1894
char const doc[] = " []" ;
1875
1895
bool ok = reader->parse (
You can’t perform that action at this time.
0 commit comments