mirror of
				https://github.com/bblanchon/ArduinoJson.git
				synced 2025-11-04 08:31:36 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			508 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			508 B
		
	
	
	
		
			C++
		
	
	
	
	
	
// ArduinoJson - https://arduinojson.org
 | 
						|
// Copyright © 2014-2023, Benoit BLANCHON
 | 
						|
// MIT License
 | 
						|
 | 
						|
#include <ArduinoJson.h>
 | 
						|
#include <catch.hpp>
 | 
						|
 | 
						|
TEST_CASE("JsonArray basics") {
 | 
						|
  JsonDocument doc;
 | 
						|
  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>());
 | 
						|
  }
 | 
						|
}
 |