Files

23 lines
492 B
C++
Raw Permalink Normal View History

2025-04-07 09:46:02 +02:00
// ArduinoJson - https://arduinojson.org
2026-07-06 18:35:16 +02:00
// Copyright © 2014-2026, Benoit BLANCHON
2025-04-07 09:46:02 +02:00
// MIT License
#include <ArduinoJson.h>
#include <catch.hpp>
struct CCLASS {
static const char mszKey[];
};
TEST_CASE("Issue #2166") {
JsonDocument doc;
doc[CCLASS::mszKey] = 12;
REQUIRE(doc.as<std::string>() == "{\"test3\":12}");
JsonObject obj = doc.to<JsonObject>();
obj[CCLASS::mszKey] = 12;
REQUIRE(doc.as<std::string>() == "{\"test3\":12}");
}
const char CCLASS::mszKey[] = "test3";