mirror of
				https://github.com/bblanchon/ArduinoJson.git
				synced 2025-11-04 00:21:36 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			318 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			318 B
		
	
	
	
		
			C++
		
	
	
	
	
	
// ArduinoJson - https://arduinojson.org
 | 
						|
// Copyright © 2014-2025, Benoit BLANCHON
 | 
						|
// MIT License
 | 
						|
 | 
						|
#include <ArduinoJson.h>
 | 
						|
#include <catch.hpp>
 | 
						|
 | 
						|
TEST_CASE("shallowCopy()") {
 | 
						|
  JsonDocument doc1, doc2;
 | 
						|
  doc1["b"] = "c";
 | 
						|
  doc2["a"].shallowCopy(doc1);
 | 
						|
 | 
						|
  REQUIRE(doc2.as<std::string>() == "{\"a\":{\"b\":\"c\"}}");
 | 
						|
}
 |