Changed the array subscript to automatically add missing elements

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

View File

@ -43,10 +43,10 @@ TEST_CASE("JsonVariant::operator[]") {
SECTION("set value") {
array.add("hello");
var[0] = "world";
var[1] = "world";
REQUIRE(1 == var.size());
REQUIRE(std::string("world") == var[0]);
REQUIRE(var.size() == 2);
REQUIRE(std::string("world") == var[1]);
}
SECTION("set value in a nested object") {