Changed the array subscript to automatically add missing elements

This commit is contained in:
Benoit Blanchon committed 2020-02-20 08:59:25 +01:00
1 parent 0001dabfd1
commit d8724e0a0b
24 files changed
+209 -93

No files matched your search

+8
View File
@@ -43,3 +43,11 @@ TEST_CASE("JsonDocument automatically promotes to object") {
REQUIRE(doc["one"]["two"]["three"] == 4);
}
TEST_CASE("JsonDocument automatically promotes to array") {
DynamicJsonDocument doc(4096);
doc[2] = 2;
REQUIRE(doc.as<std::string>() == "[null,null,2]");
}