mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-11-01 00:38:27 +01:00 
			
		
		
		
	Add a test for #1922
This commit is contained in:
		| @@ -152,3 +152,16 @@ TEST_CASE("ConverterNeedsWriteableRef") { | ||||
|   CHECK(ConverterNeedsWriteableRef<JsonArray>::value == true); | ||||
|   CHECK(ConverterNeedsWriteableRef<JsonArrayConst>::value == false); | ||||
| } | ||||
|  | ||||
| namespace ArduinoJson { | ||||
| void convertToJson(char c, JsonVariant var) { | ||||
|   char buf[] = {c, 0}; | ||||
|   var.set(buf); | ||||
| } | ||||
| }  // namespace ArduinoJson | ||||
|  | ||||
| TEST_CASE("Convert char to string") {  // issue #1922 | ||||
|   StaticJsonDocument<64> doc; | ||||
|   doc.set('a'); | ||||
|   REQUIRE(doc.as<std::string>() == "a"); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user