Add JsonVariant::link() (resolves #1343)

This commit is contained in:
Benoit Blanchon committed 2022-04-27 15:08:13 +02:00
1 parent 5577d18377
commit 3d6c328a4f
35 files changed
+649 -51

No files matched your search

+11
View File
@@ -23,4 +23,15 @@ TEST_CASE("JsonVariant::clear()") {
REQUIRE(var.isNull() == true);
}
SECTION("doesn't alter linked object") {
StaticJsonDocument<128> doc2;
doc2["hello"] = "world";
var.link(doc2);
var.clear();
CHECK(var.isNull() == true);
CHECK(doc2.as<std::string>() == "{\"hello\":\"world\"}");
}
}