fix test

parent 28ef8737
...@@ -45,15 +45,16 @@ using nlohmann::json; ...@@ -45,15 +45,16 @@ using nlohmann::json;
TEST_CASE("JSON_ASSERT(x)") TEST_CASE("JSON_ASSERT(x)")
{ {
SECTION("basic_json(first, second)")
{
assert_counter = 0; assert_counter = 0;
const json j = {{"bar", 1}};
CHECK(assert_counter == 0); CHECK(assert_counter == 0);
// accessing non-existing key in const value would assert json::iterator it;
if (j["foo"] == 1) json j;
{
CHECK(true); CHECK_THROWS_WITH_AS(json(it, j.end()), "[json.exception.invalid_iterator.201] iterators are not compatible", json::invalid_iterator);
}
CHECK(assert_counter == 1); CHECK(assert_counter == 1);
}
} }
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