mirror of
https://github.com/nlohmann/json.git
synced 2025-07-22 15:21:52 +03:00
🔨 fixed compilation error
This commit is contained in:
@ -182,32 +182,32 @@ TEST_CASE("const_iterator class")
|
||||
{
|
||||
json j(json::value_t::null);
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK_THROWS_AS(it->type_name(), json::invalid_iterator&);
|
||||
CHECK_THROWS_WITH(it->type_name(), "[json.exception.invalid_iterator.214] cannot get value");
|
||||
CHECK_THROWS_AS(std::string(it->type_name()), json::invalid_iterator&);
|
||||
CHECK_THROWS_WITH(std::string(it->type_name()), "[json.exception.invalid_iterator.214] cannot get value");
|
||||
}
|
||||
|
||||
SECTION("number")
|
||||
{
|
||||
json j(17);
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK(it->type_name() == "number");
|
||||
CHECK(std::string(it->type_name()) == "number");
|
||||
it = j.cend();
|
||||
CHECK_THROWS_AS(it->type_name(), json::invalid_iterator&);
|
||||
CHECK_THROWS_WITH(it->type_name(), "[json.exception.invalid_iterator.214] cannot get value");
|
||||
CHECK_THROWS_AS(std::string(it->type_name()), json::invalid_iterator&);
|
||||
CHECK_THROWS_WITH(std::string(it->type_name()), "[json.exception.invalid_iterator.214] cannot get value");
|
||||
}
|
||||
|
||||
SECTION("object")
|
||||
{
|
||||
json j({{"foo", "bar"}});
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK(it->type_name() == "string");
|
||||
CHECK(std::string(it->type_name()) == "string");
|
||||
}
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
json j({1, 2, 3, 4});
|
||||
json::const_iterator it = j.cbegin();
|
||||
CHECK(it->type_name() == "number");
|
||||
CHECK(std::string(it->type_name()) == "number");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user