mirror of
https://github.com/nlohmann/json.git
synced 2026-03-05 00:36:28 +00:00
✏️ cleanup after #598
This commit is contained in:
@@ -1513,70 +1513,70 @@ TEST_CASE("iterators 1")
|
||||
}
|
||||
|
||||
SECTION("conversion from iterator to const iterator")
|
||||
{
|
||||
{
|
||||
SECTION("boolean")
|
||||
{
|
||||
{
|
||||
json j = true;
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
SECTION("string")
|
||||
{
|
||||
{
|
||||
json j = "hello world";
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
SECTION("array")
|
||||
{
|
||||
{
|
||||
json j = {1, 2, 3};
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
SECTION("object")
|
||||
{
|
||||
{
|
||||
json j = {{"A", 1}, {"B", 2}, {"C", 3}};
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
SECTION("number (integer)")
|
||||
{
|
||||
{
|
||||
json j = 23;
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
SECTION("number (unsigned)")
|
||||
{
|
||||
{
|
||||
json j = 23u;
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
SECTION("number (float)")
|
||||
{
|
||||
{
|
||||
json j = 23.42;
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
SECTION("null")
|
||||
{
|
||||
{
|
||||
json j = nullptr;
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
}
|
||||
json::const_iterator it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
it = j.begin();
|
||||
CHECK(it == j.cbegin());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user