// ArduinoJson - arduinojson.org // Copyright Benoit Blanchon 2014-2018 // MIT License #include #include TEST_CASE("JsonObject::is()") { DynamicJsonDocument doc; JsonObject obj = doc.to(); obj["int"] = 42; obj["str"] = "hello"; SECTION("is(const char*)") { REQUIRE(true == obj.is("int")); REQUIRE(false == obj.is("str")); } #if HAS_VARIABLE_LENGTH_ARRAY SECTION("is(VLA)") { int i = 16; char vla[i]; strcpy(vla, "int"); REQUIRE(true == obj.is(vla)); } #endif }