Tests: add user-defined literal ""_s for std::string

This commit is contained in:
Benoit Blanchon
2024-06-07 09:35:45 +02:00
parent 5b88b2c1f6
commit 45611924f3
55 changed files with 316 additions and 229 deletions

View File

@ -5,6 +5,8 @@
#include <ArduinoJson.h>
#include <catch.hpp>
#include "Literals.hpp"
typedef ArduinoJson::detail::ElementProxy<JsonDocument&> ElementProxy;
TEST_CASE("ElementProxy::add()") {
@ -121,7 +123,7 @@ TEST_CASE("ElementProxy::remove()") {
ep["a"] = 1;
ep["b"] = 2;
ep.remove(std::string("b"));
ep.remove("b"_s);
REQUIRE(ep.as<std::string>() == "{\"a\":1}");
}