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:
@ -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}};
|
||||
|
Reference in New Issue
Block a user