Commit a3210ee2 authored by Niels's avatar Niels

increase test coverage

parent 6dceab58
...@@ -392,7 +392,7 @@ $ make ...@@ -392,7 +392,7 @@ $ make
$ ./json_unit $ ./json_unit
=============================================================================== ===============================================================================
All tests passed (4332 assertions in 18 test cases) All tests passed (4463 assertions in 18 test cases)
``` ```
For more information, have a look at the file [.travis.yml](https://github.com/nlohmann/json/blob/master/.travis.yml). For more information, have a look at the file [.travis.yml](https://github.com/nlohmann/json/blob/master/.travis.yml).
...@@ -3022,6 +3022,18 @@ TEST_CASE("element access") ...@@ -3022,6 +3022,18 @@ TEST_CASE("element access")
{ {
SECTION("erase with one valid iterator") SECTION("erase with one valid iterator")
{ {
SECTION("null")
{
{
json j;
CHECK_THROWS_AS(j.erase(j.begin()), std::runtime_error);
}
{
json j;
CHECK_THROWS_AS(j.erase(j.cbegin()), std::runtime_error);
}
}
SECTION("string") SECTION("string")
{ {
{ {
...@@ -3140,6 +3152,18 @@ TEST_CASE("element access") ...@@ -3140,6 +3152,18 @@ TEST_CASE("element access")
SECTION("erase with two valid iterators") SECTION("erase with two valid iterators")
{ {
SECTION("null")
{
{
json j;
CHECK_THROWS_AS(j.erase(j.begin(), j.end()), std::runtime_error);
}
{
json j;
CHECK_THROWS_AS(j.erase(j.cbegin(), j.cend()), std::runtime_error);
}
}
SECTION("string") SECTION("string")
{ {
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment