Commit c0427596 by Niels

improved test coverage

parent ea84a85b
...@@ -449,7 +449,7 @@ $ make ...@@ -449,7 +449,7 @@ $ make
$ ./json_unit "*" $ ./json_unit "*"
=============================================================================== ===============================================================================
All tests passed (5568699 assertions in 31 test cases) All tests passed (5568703 assertions in 31 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).
...@@ -9708,7 +9708,8 @@ basic_json_parser_63: ...@@ -9708,7 +9708,8 @@ basic_json_parser_63:
default: default:
{ {
throw std::domain_error("unexpected parent type " + parent.type_name()); // if there exists a parent it cannot be primitive
assert(false); // LCOV_EXCL_LINE
} }
} }
} }
......
...@@ -9018,7 +9018,8 @@ class basic_json ...@@ -9018,7 +9018,8 @@ class basic_json
default: default:
{ {
throw std::domain_error("unexpected parent type " + parent.type_name()); // if there exists a parent it cannot be primitive
assert(false); // LCOV_EXCL_LINE
} }
} }
} }
......
...@@ -12094,6 +12094,12 @@ TEST_CASE("JSON pointers") ...@@ -12094,6 +12094,12 @@ TEST_CASE("JSON pointers")
CHECK_THROWS_AS(json::json_pointer("/~"), std::domain_error); CHECK_THROWS_AS(json::json_pointer("/~"), std::domain_error);
CHECK_THROWS_WITH(json::json_pointer("/~"), "escape error: '~' must be followed with '0' or '1'"); CHECK_THROWS_WITH(json::json_pointer("/~"), "escape error: '~' must be followed with '0' or '1'");
json::json_pointer p;
CHECK_THROWS_AS(p.top(), std::domain_error);
CHECK_THROWS_WITH(p.top(), "JSON pointer has no parent");
CHECK_THROWS_AS(p.pop_back(), std::domain_error);
CHECK_THROWS_WITH(p.pop_back(), "JSON pointer has no parent");
} }
SECTION("examples from RFC 6901") SECTION("examples from RFC 6901")
......
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