mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-14 02:56:35 +02: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("JsonObjectConst::containsKey()") {
|
||||
JsonDocument doc;
|
||||
doc["hello"] = 42;
|
||||
@ -16,8 +18,8 @@ TEST_CASE("JsonObjectConst::containsKey()") {
|
||||
}
|
||||
|
||||
SECTION("supports std::string") {
|
||||
REQUIRE(false == obj.containsKey(std::string("world")));
|
||||
REQUIRE(true == obj.containsKey(std::string("hello")));
|
||||
REQUIRE(false == obj.containsKey("world"_s));
|
||||
REQUIRE(true == obj.containsKey("hello"_s));
|
||||
}
|
||||
|
||||
#ifdef HAS_VARIABLE_LENGTH_ARRAY
|
||||
|
Reference in New Issue
Block a user