mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
21 lines
406 B
C++
21 lines
406 B
C++
// ArduinoJson - arduinojson.org
|
|
// Copyright Benoit Blanchon 2014-2018
|
|
// MIT License
|
|
|
|
#include <ArduinoJson.h>
|
|
#include <catch.hpp>
|
|
|
|
TEST_CASE("DynamicJsonDocument") {
|
|
DynamicJsonDocument doc;
|
|
|
|
SECTION("serializeJson()") {
|
|
JsonObject obj = doc.to<JsonObject>();
|
|
obj["hello"] = "world";
|
|
|
|
std::string json;
|
|
serializeJson(doc, json);
|
|
|
|
REQUIRE(json == "{\"hello\":\"world\"}");
|
|
}
|
|
}
|