Added JsonArrayConst, JsonObjectConst, and JsonVariantConst

This commit is contained in:
Benoit Blanchon
2018-10-12 12:00:27 +02:00
parent d1003ff6c9
commit b0560cbd99
47 changed files with 1909 additions and 1063 deletions

View File

@ -158,4 +158,16 @@ TEST_CASE("JsonVariant::as()") {
REQUIRE(variant.as<long long>() == 9223372036854775807);
}
#endif
SECTION("should work on JsonVariantConst") {
variant.set("hello");
JsonVariantConst cvar = variant;
REQUIRE(cvar.as<bool>() == false);
REQUIRE(cvar.as<long>() == 0L);
REQUIRE(cvar.as<const char*>() == std::string("hello"));
REQUIRE(cvar.as<char*>() == std::string("hello"));
// REQUIRE(cvar.as<std::string>() == std::string("hello"));
}
}