Added serializeMsgPack() and measureMsgPack() (closes #358)

This commit is contained in:
Benoit Blanchon
2018-05-29 08:31:17 +02:00
parent 58cb793c96
commit fc2e3a4ab3
59 changed files with 975 additions and 391 deletions

View File

@ -15,14 +15,14 @@ TEST_CASE("serialize JsonArray to std::string") {
std::string json;
serializeJson(array, json);
REQUIRE(std::string("[4,2]") == json);
REQUIRE("[4,2]" == json);
}
SECTION("serializeJsonPretty") {
std::string json;
serializeJsonPretty(array, json);
REQUIRE(std::string("[\r\n 4,\r\n 2\r\n]") == json);
REQUIRE("[\r\n 4,\r\n 2\r\n]" == json);
}
}
@ -35,13 +35,13 @@ TEST_CASE("serialize JsonObject to std::string") {
std::string json;
serializeJson(doc, json);
REQUIRE(std::string("{\"key\":\"value\"}") == json);
REQUIRE("{\"key\":\"value\"}" == json);
}
SECTION("serializeJsonPretty") {
std::string json;
serializeJsonPretty(doc, json);
REQUIRE(std::string("{\r\n \"key\": \"value\"\r\n}") == json);
REQUIRE("{\r\n \"key\": \"value\"\r\n}" == json);
}
}