mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-06-07 17:14:56 +02: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;
|
Json::Value root;
|
||||||
std::string errs;
|
std::string errs;
|
||||||
Json::CharReader* reader(b.newCharReader());
|
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[] = "[]";
|
char const doc[] = "[]";
|
||||||
bool ok = reader->parse(
|
bool ok = reader->parse(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user