mirror of
https://github.com/nlohmann/json.git
synced 2026-10-13 09:47:12 +00:00
+ more test cases
This commit is contained in:
1 parent
aacb58e56b
commit
ea85da8a55
1 file changed
+35
-4
+35
-4
@@ -1407,10 +1407,41 @@ TEST_CASE("Iterators")
|
||||
{
|
||||
JSON j;
|
||||
const JSON j_const = j;
|
||||
for (JSON::iterator i = j.begin(); i != j.end(); ++i);
|
||||
for (JSON::const_iterator i = j.cbegin(); i != j.cend(); ++i);
|
||||
for (JSON::const_iterator i = j_const.begin(); i != j_const.end(); ++i);
|
||||
for (JSON::const_iterator i = j_const.cbegin(); i != j_const.cend(); ++i);
|
||||
{
|
||||
JSON::iterator i = j.begin();
|
||||
++i;
|
||||
CHECK(i == j.end());
|
||||
++i;
|
||||
CHECK(i == j.end());
|
||||
}
|
||||
{
|
||||
JSON::const_iterator i = j.begin();
|
||||
++i;
|
||||
CHECK(i == j.end());
|
||||
++i;
|
||||
CHECK(i == j.end());
|
||||
}
|
||||
{
|
||||
JSON::const_iterator i = j_const.begin();
|
||||
++i;
|
||||
CHECK(i == j_const.end());
|
||||
++i;
|
||||
CHECK(i == j_const.end());
|
||||
}
|
||||
{
|
||||
JSON::const_iterator i = j.cbegin();
|
||||
++i;
|
||||
CHECK(i == j.cend());
|
||||
++i;
|
||||
CHECK(i == j.cend());
|
||||
}
|
||||
{
|
||||
JSON::const_iterator i = j_const.cbegin();
|
||||
++i;
|
||||
CHECK(i == j_const.cend());
|
||||
++i;
|
||||
CHECK(i == j_const.cend());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user