mirror of
				https://github.com/bblanchon/ArduinoJson.git
				synced 2025-11-04 00:21:36 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			652 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			652 B
		
	
	
	
		
			C++
		
	
	
	
	
	
// ArduinoJson - https://arduinojson.org
 | 
						|
// Copyright © 2014-2024, Benoit BLANCHON
 | 
						|
// MIT License
 | 
						|
 | 
						|
#include <ArduinoJson.h>
 | 
						|
#include <catch.hpp>
 | 
						|
 | 
						|
TEST_CASE("JsonDocument::operator==(const JsonDocument&)") {
 | 
						|
  JsonDocument doc1;
 | 
						|
  JsonDocument doc2;
 | 
						|
 | 
						|
  SECTION("Empty") {
 | 
						|
    REQUIRE(doc1 == doc2);
 | 
						|
    REQUIRE_FALSE(doc1 != doc2);
 | 
						|
  }
 | 
						|
 | 
						|
  SECTION("With same object") {
 | 
						|
    doc1["hello"] = "world";
 | 
						|
    doc2["hello"] = "world";
 | 
						|
    REQUIRE(doc1 == doc2);
 | 
						|
    REQUIRE_FALSE(doc1 != doc2);
 | 
						|
  }
 | 
						|
  SECTION("With different object") {
 | 
						|
    doc1["hello"] = "world";
 | 
						|
    doc2["world"] = "hello";
 | 
						|
    REQUIRE_FALSE(doc1 == doc2);
 | 
						|
    REQUIRE(doc1 != doc2);
 | 
						|
  }
 | 
						|
}
 |