mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
clear()
This commit is contained in:
@@ -23,4 +23,15 @@ TEST_CASE("JsonVariant::clear()") {
|
|||||||
|
|
||||||
REQUIRE(var.isNull() == true);
|
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\"}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user