You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MicroDexed/third-party/ArduinoJson/extras/tests/JsonArray/createNested.cpp

21 lines
521 B

// ArduinoJson - https://arduinojson.org
// Copyright © 2014-2023, Benoit BLANCHON
// MIT License
#include <ArduinoJson.h>
#include <catch.hpp>
TEST_CASE("JsonArray basics") {
DynamicJsonDocument doc(4096);
JsonArray array = doc.to<JsonArray>();
SECTION("CreateNestedArray") {
JsonArray arr = array.createNestedArray();
REQUIRE(arr == array[0].as<JsonArray>());
}
SECTION("CreateNestedObject") {
JsonObject obj = array.createNestedObject();
REQUIRE(obj == array[0].as<JsonObject>());
}
}