forked from bblanchon/ArduinoJson
Added JsonArrayConst, JsonObjectConst, and JsonVariantConst
This commit is contained in:
1 parent
d1003ff6c9
commit
b0560cbd99
47 files changed
+1909
-1063
No files matched your search
@@ -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"));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user