mirror of
https://github.com/nlohmann/json.git
synced 2024-12-03 21:59:08 +08:00
✅ fix test
This commit is contained in:
parent
28ef87370b
commit
1b04092c5c
@ -45,15 +45,16 @@ using nlohmann::json;
|
||||
|
||||
TEST_CASE("JSON_ASSERT(x)")
|
||||
{
|
||||
SECTION("basic_json(first, second)")
|
||||
{
|
||||
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)
|
||||
{
|
||||
CHECK(true);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user