Commit 6e6dd5f4 authored by Niels's avatar Niels

added test cases for the last uncovered lines

parent 40312fb0
......@@ -8009,6 +8009,39 @@ TEST_CASE("parser class")
}
}
}
SECTION("special cases")
{
// the following test cases cover the situation in which an empty
// object and array is discarded only after the closing character
// has been read
json j_empty_object = json::parse("{}", [](int, json::parse_event_t e, const json&)
{
if (e == json::parse_event_t::object_end)
{
return false;
}
else
{
return true;
}
});
CHECK(j_empty_object == json());
json j_empty_array = json::parse("[]", [](int, json::parse_event_t e, const json&)
{
if (e == json::parse_event_t::array_end)
{
return false;
}
else
{
return true;
}
});
CHECK(j_empty_array == json());
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment