Skip to content

Commit eed193e

Browse files
committed
object cases; 1st passes, 2nd fails
1 parent 4382a7b commit eed193e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/test_lib_json/main.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,26 @@ JSONTEST_FIXTURE(CharReaderAllowDropNullTest, issue178) {
18701870
Json::Value root;
18711871
std::string errs;
18721872
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+
}
18731893
{
18741894
char const doc[] = "[]";
18751895
bool ok = reader->parse(

0 commit comments

Comments
 (0)