Test JsonVariantConst as well

This commit is contained in:
Benoit Blanchon
2022-03-10 18:49:21 +01:00
parent 412ca3e5fa
commit a215d70af6

View File

@@ -221,4 +221,12 @@ TEST_CASE("JsonVariantConst::operator[]") {
REQUIRE(var.is<JsonObject>() == false);
REQUIRE(value == 0);
}
SECTION("get value from linked object") {
StaticJsonDocument<1024> doc1, doc2;
doc2["hello"] = "world";
var.link(doc2);
CHECK(cvar["hello"].as<std::string>() == "world");
}
}