Add more tests for JsonObjectConst

This commit is contained in:
Benoit Blanchon
2024-01-08 18:48:11 +01:00
parent 44d2d47863
commit 08cac13c43
15 changed files with 281 additions and 89 deletions

View File

@ -7,8 +7,6 @@
#include "Allocators.hpp"
using ArduinoJson::detail::sizeofObject;
TEST_CASE("JsonObject::operator[]") {
SpyingAllocator spy;
JsonDocument doc(&spy);
@ -252,11 +250,3 @@ 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
}