From a215d70af6c9f52860e9a4ce1a7a15d2531e6fd8 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Thu, 10 Mar 2022 18:49:21 +0100 Subject: [PATCH] Test JsonVariantConst as well --- extras/tests/JsonVariant/subscript.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extras/tests/JsonVariant/subscript.cpp b/extras/tests/JsonVariant/subscript.cpp index 9874819c..a03b2914 100644 --- a/extras/tests/JsonVariant/subscript.cpp +++ b/extras/tests/JsonVariant/subscript.cpp @@ -221,4 +221,12 @@ TEST_CASE("JsonVariantConst::operator[]") { REQUIRE(var.is() == false); REQUIRE(value == 0); } + + SECTION("get value from linked object") { + StaticJsonDocument<1024> doc1, doc2; + doc2["hello"] = "world"; + var.link(doc2); + + CHECK(cvar["hello"].as() == "world"); + } }