MemberProxy.link()

This commit is contained in:
Benoit Blanchon
2022-03-14 19:44:57 +01:00
parent b02d979ceb
commit 0cd588c249
2 changed files with 12 additions and 0 deletions

View File

@@ -277,3 +277,11 @@ TEST_CASE("MemberProxy::createNestedObject(key)") {
CHECK(doc["status"]["weather"]["temp"] == 42);
}
TEST_CASE("MemberProxy::link()") {
StaticJsonDocument<1024> doc1, doc2;
doc1["obj"].link(doc2);
doc2["hello"] = "world";
CHECK(doc1.as<std::string>() == "{\"obj\":{\"hello\":\"world\"}}");
}