mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-06-25 09:21:34 +02:00
24 lines
611 B
C++
24 lines
611 B
C++
// ArduinoJson - arduinojson.org
|
|
// Copyright Benoit Blanchon 2014-2023
|
|
// MIT License
|
|
|
|
#include <ArduinoJson.h>
|
|
|
|
#include <catch.hpp>
|
|
|
|
TEST_CASE("JsonObject::createNestedArray()") {
|
|
DynamicJsonBuffer _jsonBuffer;
|
|
JsonObject& _object = _jsonBuffer.createObject();
|
|
|
|
SECTION("success() should return true if key is non-null") {
|
|
JsonArray& arr = _object.createNestedArray("key");
|
|
REQUIRE(arr.success() == true);
|
|
}
|
|
|
|
SECTION("success() should return false if key is null") {
|
|
const char* null = 0;
|
|
JsonArray& arr = _object.createNestedArray(null);
|
|
REQUIRE(arr.success() == false);
|
|
}
|
|
}
|