mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-11-01 15:11:38 +01:00
Tests: add user-defined literal ""_s for std::string
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include <ArduinoJson.h>
|
||||
#include <catch.hpp>
|
||||
|
||||
#include "Literals.hpp"
|
||||
|
||||
TEST_CASE("serialize JsonArray to std::string") {
|
||||
JsonDocument doc;
|
||||
JsonArray array = doc.to<JsonArray>();
|
||||
@@ -48,7 +50,7 @@ TEST_CASE("serialize JsonObject to std::string") {
|
||||
|
||||
TEST_CASE("serialize an std::string containing a NUL") {
|
||||
JsonDocument doc;
|
||||
doc.set(std::string("hello\0world", 11));
|
||||
doc.set("hello\0world"_s);
|
||||
|
||||
std::string json = "erase me";
|
||||
serializeJson(doc, json);
|
||||
|
||||
Reference in New Issue
Block a user