Files
Benoit Blanchon 18671a5f3b Replace catch with doctest
This reduces the build times by about 38%
2026-07-06 17:59:49 +02:00

28 lines
517 B
C++

// ArduinoJson - https://arduinojson.org
// Copyright © 2014-2025, Benoit BLANCHON
// MIT License
#include <ArduinoJson.h>
#include <doctest.h>
#include "Literals.hpp"
TEST_CASE("Unbound JsonObject") {
JsonObject obj;
SUBCASE("retrieve member") {
REQUIRE(obj["key"].isNull());
}
SUBCASE("add member") {
obj["hello"] = "world";
REQUIRE(0 == obj.size());
}
SUBCASE("serialize") {
char buffer[32];
serializeJson(obj, buffer, sizeof(buffer));
REQUIRE(buffer == "null"_s);
}
}