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

@@ -43,4 +43,14 @@ TEST_CASE("JsonVariant::add()") {
REQUIRE(var.as<std::string>() == "{\"val\":123}");
}
SECTION("add to linked array") {
StaticJsonDocument<1024> doc2;
doc2.add(42);
var.link(doc2);
var.add(666); // no-op
CHECK(var.as<std::string>() == "[42]");
}
}