Skip to content

Commit

Permalink
fixed coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Feb 18, 2015
1 parent afd02ee commit c8c49da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2211,9 +2211,10 @@ TEST_CASE("element access")
SECTION("null")
{
json j_nonobject(json::value_t::null);
json j_nonobject2(json::value_t::null);
const json j_const_nonobject(j_nonobject);
CHECK_NOTHROW(j_nonobject["foo"]);
CHECK_NOTHROW(j_nonobject[json::object_t::key_type("foo")]);
CHECK_NOTHROW(j_nonobject2[json::object_t::key_type("foo")]);
CHECK_THROWS_AS(j_const_nonobject["foo"], std::runtime_error);
CHECK_THROWS_AS(j_const_nonobject[json::object_t::key_type("foo")], std::runtime_error);
}
Expand Down

0 comments on commit c8c49da

Please sign in to comment.