smoke_test.cpp 310 B

123456789101112131415
  1. #include <ArduinoJson.h>
  2. #include <catch.hpp>
  3. #include <string>
  4. TEST_CASE("C++20 smoke test") {
  5. StaticJsonDocument<128> doc;
  6. deserializeJson(doc, "{\"hello\":\"world\"}");
  7. REQUIRE(doc["hello"] == "world");
  8. std::string json;
  9. serializeJson(doc, json);
  10. REQUIRE(json == "{\"hello\":\"world\"}");
  11. }