mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-14 11:06:35 +02:00
Tests: add user-defined literal ""_s
for std::string
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
|
||||
#include <catch.hpp>
|
||||
|
||||
#include "Literals.hpp"
|
||||
#include "custom_string.hpp"
|
||||
|
||||
using namespace ArduinoJson::detail;
|
||||
@ -36,13 +37,13 @@ void common_tests(StringWriter& writer, const String& output) {
|
||||
|
||||
SECTION("OneString") {
|
||||
REQUIRE(4 == print(writer, "ABCD"));
|
||||
REQUIRE(std::string("ABCD") == output);
|
||||
REQUIRE("ABCD"_s == output);
|
||||
}
|
||||
|
||||
SECTION("TwoStrings") {
|
||||
REQUIRE(4 == print(writer, "ABCD"));
|
||||
REQUIRE(4 == print(writer, "EFGH"));
|
||||
REQUIRE(std::string("ABCDEFGH") == output);
|
||||
REQUIRE("ABCDEFGH"_s == output);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user