We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52d8a65 commit cd5566cCopy full SHA for cd5566c
extras/tests/JsonVariant/converters.cpp
@@ -152,3 +152,16 @@ TEST_CASE("ConverterNeedsWriteableRef") {
152
CHECK(ConverterNeedsWriteableRef<JsonArray>::value == true);
153
CHECK(ConverterNeedsWriteableRef<JsonArrayConst>::value == false);
154
}
155
+
156
+namespace ArduinoJson {
157
+void convertToJson(char c, JsonVariant var) {
158
+ char buf[] = {c, 0};
159
+ var.set(buf);
160
+}
161
+} // namespace ArduinoJson
162
163
+TEST_CASE("Convert char to string") { // issue #1922
164
+ StaticJsonDocument<64> doc;
165
+ doc.set('a');
166
+ REQUIRE(doc.as<std::string>() == "a");
167
0 commit comments