improved documentation and test coverage
This commit is contained in:
parent
7034ae2486
commit
6268287940
7 changed files with 105 additions and 24 deletions
|
@ -12365,6 +12365,11 @@ TEST_CASE("JSON pointers")
|
|||
CHECK_THROWS_AS(json({{"/1", {1, 2, 3}}}).unflatten(), std::domain_error);
|
||||
CHECK_THROWS_WITH(json({{"/1", {1, 2, 3}}}).unflatten(), "values in object must be primitive");
|
||||
|
||||
// error for conflicting values
|
||||
json j_error = {{"", 42}, {"/foo", 17}};
|
||||
CHECK_THROWS_AS(j_error.unflatten(), std::domain_error);
|
||||
CHECK_THROWS_WITH(j_error.unflatten(), "unresolved reference token 'foo'");
|
||||
|
||||
// explicit roundtrip check
|
||||
CHECK(j.flatten().unflatten() == j);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue