1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-21 04:22:05 +03:00

Merge branch 'develop' into feature/exceptions_3.0.0

This commit is contained in:
Niels Lohmann
2017-03-12 11:51:24 +01:00
7 changed files with 116 additions and 8 deletions

View File

@ -585,10 +585,11 @@ TEST_CASE("modifiers")
SECTION("insert nothing (count = 0)")
{
auto pos = j_array.end();
auto it = j_array.insert(j_array.end(), 0, 5);
CHECK(j_array.size() == 4);
CHECK(it == pos);
// the returned iterator points to the first inserted element;
// there were 4 elements, so it should point to the 5th
CHECK(it == j_array.begin() + 4);
CHECK(j_array == json({1, 2, 3, 4}));
}
}