first commit
This commit is contained in:
commit
e6a42e28e9
4355 changed files with 4626605 additions and 0 deletions
18
libraries/ArduinoJson/extras/tests/JsonDocument/cast.cpp
Normal file
18
libraries/ArduinoJson/extras/tests/JsonDocument/cast.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright © 2014-2025, Benoit BLANCHON
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <catch.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
TEST_CASE("Implicit cast to JsonVariant") {
|
||||
JsonDocument doc;
|
||||
|
||||
doc["hello"] = "world";
|
||||
|
||||
JsonVariant var = doc;
|
||||
|
||||
CHECK(var.as<std::string>() == "{\"hello\":\"world\"}");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue