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

23 lines
467 B
C++

// ArduinoJson - https://arduinojson.org
// Copyright © 2014-2025, Benoit BLANCHON
// MIT License
#include <ArduinoJson.h>
#include <doctest.h>
#include <string>
TEST_CASE("JsonObjectConst::size()") {
JsonDocument doc;
JsonObjectConst obj = doc.to<JsonObject>();
SUBCASE("returns 0 when empty") {
REQUIRE(0 == obj.size());
}
SUBCASE("returns the number of members") {
doc["hello"] = 1;
doc["world"] = 2;
REQUIRE(2 == obj.size());
}
}