added test case from issue #283

This commit is contained in:
Niels 2016-07-24 11:08:39 +02:00
parent e2aa2d2189
commit 84673b7de3

View file

@ -14331,6 +14331,19 @@ TEST_CASE("regression tests")
// check roundtrip // check roundtrip
CHECK(doc.patch(json::diff(doc, expected)) == expected); CHECK(doc.patch(json::diff(doc, expected)) == expected);
} }
SECTION("issue #283 - value() does not work with _json_pointer types")
{
json j =
{
{"object", {{"key1", 1}, {"key2", 2}}},
};
int at_integer = j.at("/object/key2"_json_pointer);
int val_integer = j.value("/object/key2"_json_pointer, 0);
CHECK(at_integer == val_integer);
}
} }
// special test case to check if memory is leaked if constructor throws // special test case to check if memory is leaked if constructor throws