forked from bblanchon/ArduinoJson
21 lines
409 B
C++
21 lines
409 B
C++
// ArduinoJson - arduinojson.org
|
|
// Copyright Benoit Blanchon 2014-2018
|
|
// MIT License
|
|
|
|
#include <ArduinoJson.h>
|
|
#include <catch.hpp>
|
|
|
|
TEST_CASE("StaticJsonDocument") {
|
|
StaticJsonDocument<200> doc;
|
|
|
|
SECTION("serializeJson()") {
|
|
JsonObject obj = doc.to<JsonObject>();
|
|
obj["hello"] = "world";
|
|
|
|
std::string json;
|
|
serializeJson(doc, json);
|
|
|
|
REQUIRE(json == "{\"hello\":\"world\"}");
|
|
}
|
|
}
|