mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Added more tests of JsonVariant::is<T>()
This commit is contained in:
@@ -147,4 +147,16 @@ TEST_CASE("JsonVariant::is()") {
|
||||
SECTION("string") {
|
||||
testString("42");
|
||||
}
|
||||
|
||||
SECTION("null") {
|
||||
DynamicJsonDocument doc(4096);
|
||||
deserializeJson(doc, "[null]");
|
||||
JsonVariant v = doc[0];
|
||||
|
||||
REQUIRE(v.is<bool>() == false);
|
||||
REQUIRE(v.is<char *>() == false);
|
||||
REQUIRE(v.is<int>() == false);
|
||||
REQUIRE(v.is<std::string>() == false);
|
||||
REQUIRE(v.is<float>() == false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user