shallowCopy.cpp 318 B

1234567891011121314
  1. // ArduinoJson - https://arduinojson.org
  2. // Copyright © 2014-2025, Benoit BLANCHON
  3. // MIT License
  4. #include <ArduinoJson.h>
  5. #include <catch.hpp>
  6. TEST_CASE("shallowCopy()") {
  7. JsonDocument doc1, doc2;
  8. doc1["b"] = "c";
  9. doc2["a"].shallowCopy(doc1);
  10. REQUIRE(doc2.as<std::string>() == "{\"a\":{\"b\":\"c\"}}");
  11. }