first commit
This commit is contained in:
commit
e6a42e28e9
4355 changed files with 4626605 additions and 0 deletions
22
libraries/ArduinoJson/extras/tests/Misc/issue2166.cpp
Normal file
22
libraries/ArduinoJson/extras/tests/Misc/issue2166.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright © 2014-2025, Benoit BLANCHON
|
||||
// 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";
|
||||
Loading…
Add table
Add a link
Reference in a new issue