mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 08:42:39 +01:00 
			
		
		
		
	Moved ancillary files to extras/ (fixes #1011)
				
					
				
			This commit is contained in:
		
							
								
								
									
										21
									
								
								extras/tests/JsonArray/createNested.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								extras/tests/JsonArray/createNested.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| // ArduinoJson - arduinojson.org | ||||
| // Copyright Benoit Blanchon 2014-2019 | ||||
| // 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>()); | ||||
|   } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user