1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

+ more test cases

This commit is contained in:
Niels
2014-12-28 14:57:21 +01:00
parent 2e26faf91c
commit a68b4cafa2
3 changed files with 18 additions and 2 deletions

View File

@ -507,6 +507,10 @@ TEST_CASE("object")
JSON nonarray = 1;
CHECK_THROWS_AS(const int i = nonarray["v1"], std::domain_error);
CHECK_THROWS_AS(nonarray["v1"] = 10, std::domain_error);
{
const JSON c = {{"foo", "bar"}};
CHECK_THROWS_AS(c[std::string("baz")], std::out_of_range);
}
// clear()
JSON j7 = {{"k0", 0}, {"k1", 1}, {"k2", 2}, {"k3", 3}};