Increased test coverage

This commit is contained in:
Benoit Blanchon
2021-09-10 08:40:02 +02:00
parent 6a71f31820
commit e0cd5b6405
9 changed files with 147 additions and 49 deletions

View File

@ -58,6 +58,15 @@ TEST_CASE("JsonVariant::operator[]") {
REQUIRE(1 == var[0].size());
REQUIRE(std::string("world") == var[0]["hello"]);
}
SECTION("variant[0] when variant contains an integer") {
var.set(123);
var[0] = 345; // no-op
REQUIRE(var.is<int>());
REQUIRE(var.as<int>() == 123);
}
}
SECTION("The JsonVariant is a JsonObject") {