Add JsonVariant::link()

This commit is contained in:
Benoit Blanchon
2022-03-10 13:50:01 +01:00
parent bf5d0c790c
commit f5cf7a8a20
28 changed files with 705 additions and 52 deletions

View File

@@ -245,3 +245,11 @@ TEST_CASE("ElementProxy cast to JsonVariant") {
CHECK(doc.as<std::string>() == "[\"toto\"]");
}
TEST_CASE("ElementProxy::link()") {
StaticJsonDocument<1024> doc1, doc2;
doc1[0].link(doc2);
doc2["hello"] = "world";
CHECK(doc1.as<std::string>() == "[{\"hello\":\"world\"}]");
}