mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-16 12:02:14 +02:00
Fix "no matching function" with JsonObjectConst::operator[]
Fixes #2019
This commit is contained in:
@ -252,3 +252,11 @@ TEST_CASE("JsonObject::operator[]") {
|
||||
REQUIRE(false == obj["hello"]["world"].is<bool>());
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("JsonObjectConst::operator[]") {
|
||||
JsonDocument doc;
|
||||
doc["hello"] = "world";
|
||||
JsonObjectConst obj = doc.as<JsonObjectConst>();
|
||||
|
||||
REQUIRE(obj["hello"] == "world"); // issue #2019
|
||||
}
|
||||
|
Reference in New Issue
Block a user