Test JsonDocument constructor with a JsonVariantConst argument

See #2091
This commit is contained in:
Benoit Blanchon
2024-05-15 09:30:22 +02:00
parent 68a13117dc
commit 1c5e5db071

View File

@ -117,4 +117,13 @@ TEST_CASE("JsonDocument constructor") {
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");
}
}