Files

30 lines
652 B
C++
Raw Permalink Normal View History

// ArduinoJson - https://arduinojson.org
2026-07-06 18:35:16 +02:00
// Copyright © 2014-2026, Benoit BLANCHON
2019-07-19 10:10:16 +02:00
// MIT License
#include <ArduinoJson.h>
#include <catch.hpp>
2023-03-20 10:49:01 +01:00
TEST_CASE("JsonDocument::operator==(const JsonDocument&)") {
JsonDocument doc1;
JsonDocument doc2;
2019-07-19 10:10:16 +02:00
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);
}
}