Fixed operator|(MemberProxy, JsonObject) (fixes #1415)

This commit is contained in:
Benoit Blanchon
2020-10-23 10:22:14 +02:00
parent ff66182dc6
commit 10ec0f21b0
7 changed files with 50 additions and 8 deletions

View File

@ -121,6 +121,17 @@ TEST_CASE("MemberProxy::operator|()") {
REQUIRE(sensor == std::string("gps"));
}
SECTION("Issue #1415") {
JsonObject object = doc.to<JsonObject>();
object["hello"] = "world";
StaticJsonDocument<0> emptyDoc;
JsonObject anotherObject = object["hello"] | emptyDoc.to<JsonObject>();
REQUIRE(anotherObject.isNull() == false);
REQUIRE(anotherObject.size() == 0);
}
}
TEST_CASE("MemberProxy::remove()") {