mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-15 02:17:55 +08:00
object cases; 1st passes, 2nd fails
This commit is contained in:
parent
4382a7b585
commit
eed193e151
@ -1870,6 +1870,26 @@ JSONTEST_FIXTURE(CharReaderAllowDropNullTest, issue178) {
|
||||
Json::Value root;
|
||||
std::string errs;
|
||||
Json::CharReader* reader(b.newCharReader());
|
||||
{
|
||||
char const doc[] = "{\"a\":,\"b\":true}";
|
||||
bool ok = reader->parse(
|
||||
doc, doc + std::strlen(doc),
|
||||
&root, &errs);
|
||||
JSONTEST_ASSERT(ok);
|
||||
JSONTEST_ASSERT_STRING_EQUAL("", errs);
|
||||
JSONTEST_ASSERT_EQUAL(2u, root.size());
|
||||
JSONTEST_ASSERT_EQUAL(Json::nullValue, root.get("a", true));
|
||||
}
|
||||
{
|
||||
char const doc[] = "{\"a\":}";
|
||||
bool ok = reader->parse(
|
||||
doc, doc + std::strlen(doc),
|
||||
&root, &errs);
|
||||
JSONTEST_ASSERT(ok);
|
||||
JSONTEST_ASSERT_STRING_EQUAL("", errs);
|
||||
JSONTEST_ASSERT_EQUAL(1u, root.size());
|
||||
JSONTEST_ASSERT_EQUAL(Json::nullValue, root.get("a", true));
|
||||
}
|
||||
{
|
||||
char const doc[] = "[]";
|
||||
bool ok = reader->parse(
|
||||
|
Loading…
x
Reference in New Issue
Block a user