fix test

This commit is contained in:
Niels Lohmann
2020-07-08 12:38:46 +02:00
parent 28ef87370b
commit 1b04092c5c
2 changed files with 16 additions and 15 deletions

View File

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