forked from bblanchon/ArduinoJson
Added RawJson()
to insert pregenerated JSON portions (issue #259)
This commit is contained in:
@ -8,8 +8,6 @@
|
||||
#include <ArduinoJson.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
using namespace ArduinoJson::Internals;
|
||||
|
||||
class JsonObject_PrintTo_Tests : public testing::Test {
|
||||
public:
|
||||
JsonObject_PrintTo_Tests() : _object(_jsonBuffer.createObject()) {}
|
||||
@ -75,6 +73,12 @@ TEST_F(JsonObject_PrintTo_Tests, TwoIntegers) {
|
||||
outputMustBe("{\"a\":1,\"b\":2}");
|
||||
}
|
||||
|
||||
TEST_F(JsonObject_PrintTo_Tests, RawJson) {
|
||||
_object["a"] = RawJson("[1,2]");
|
||||
_object.set("b", RawJson("[4,5]"));
|
||||
outputMustBe("{\"a\":[1,2],\"b\":[4,5]}");
|
||||
}
|
||||
|
||||
TEST_F(JsonObject_PrintTo_Tests, TwoDoublesFourDigits) {
|
||||
_object["a"] = double_with_n_digits(3.14159265358979323846, 4);
|
||||
_object.set("b", 2.71828182845904523536, 4);
|
||||
|
Reference in New Issue
Block a user