Improved coverage of JsonObject

This commit is contained in:
Benoit Blanchon
2020-02-23 13:03:14 +01:00
parent a471aed6db
commit 0214c9bcad
4 changed files with 47 additions and 0 deletions

View File

@ -94,4 +94,22 @@ TEST_CASE("JsonObject::set()") {
REQUIRE(success == false);
REQUIRE(doc3.as<std::string>() == "{\"hello\":null}");
}
SECTION("destination is null") {
JsonObject null;
obj1["hello"] = "world";
bool success = null.set(obj1);
REQUIRE(success == false);
}
SECTION("source is null") {
JsonObject null;
obj1["hello"] = "world";
bool success = obj1.set(null);
REQUIRE(success == false);
}
}