Allow using a JsonVariant as a key or index

Closes #2080
This commit is contained in:
Benoit Blanchon
2024-05-14 21:06:02 +02:00
parent 071f718473
commit 68a13117dc
26 changed files with 393 additions and 34 deletions

View File

@ -23,4 +23,12 @@ TEST_CASE("JsonVariant::containsKey()") {
REQUIRE(var.containsKey(std::string("hello")) == true);
REQUIRE(var.containsKey(std::string("world")) == false);
}
SECTION("containsKey(JsonVariant)") {
var["hello"] = "world";
var["key"] = "hello";
REQUIRE(var.containsKey(doc["key"]) == true);
REQUIRE(var.containsKey(doc["foo"]) == false);
}
}