mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-16 03:52:16 +02:00
Test JsonDocument
constructor with a JsonVariantConst
argument
See #2091
This commit is contained in:
@ -117,4 +117,13 @@ TEST_CASE("JsonDocument constructor") {
|
|||||||
|
|
||||||
REQUIRE(doc2.as<std::string>() == "hello");
|
REQUIRE(doc2.as<std::string>() == "hello");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SECTION("JsonDocument(JsonVariantConst)") {
|
||||||
|
JsonDocument doc1;
|
||||||
|
deserializeJson(doc1, "\"hello\"");
|
||||||
|
|
||||||
|
JsonDocument doc2(doc1.as<JsonVariantConst>());
|
||||||
|
|
||||||
|
REQUIRE(doc2.as<std::string>() == "hello");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user