diff options
author | luckybug <luckybug@yandex-team.ru> | 2022-02-10 16:50:26 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:26 +0300 |
commit | a6d369648d0e4e2d446acfd469aced762d3c0492 (patch) | |
tree | a4a12fa83066f49578432d73b5cc9e01aff081f3 /library/cpp/json/ut/json_saveload_ut.cpp | |
parent | 74b68813c7dbee6e7538883986e9657eb0593d86 (diff) | |
download | ydb-a6d369648d0e4e2d446acfd469aced762d3c0492.tar.gz |
Restoring authorship annotation for <luckybug@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/json/ut/json_saveload_ut.cpp')
-rw-r--r-- | library/cpp/json/ut/json_saveload_ut.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/library/cpp/json/ut/json_saveload_ut.cpp b/library/cpp/json/ut/json_saveload_ut.cpp index b480a80fe4..7ffe0668dd 100644 --- a/library/cpp/json/ut/json_saveload_ut.cpp +++ b/library/cpp/json/ut/json_saveload_ut.cpp @@ -1,36 +1,36 @@ #include <library/cpp/json/json_value.h> - + #include <library/cpp/testing/unittest/registar.h> -#include <util/stream/buffer.h> -#include <util/generic/buffer.h> -#include <util/ysaveload.h> - -Y_UNIT_TEST_SUITE(JsonSaveLoad) { - Y_UNIT_TEST(Serialize) { - - NJson::TJsonValue expected; - - expected["ui64"] = ui64(1); - expected["i64"] = i64(2); - expected["double"] = 2.0; - expected["string"] = "text"; - expected["map"] = expected; - expected["array"].SetType(NJson::JSON_ARRAY).GetArraySafe().emplace_back(expected); - expected["null"].SetType(NJson::JSON_NULL); - expected["undefined"].SetType(NJson::JSON_UNDEFINED); - - TBuffer buffer; - { - TBufferOutput output(buffer); - ::Save(&output, expected); - } - - NJson::TJsonValue load; - { - TBufferInput input(buffer); - ::Load(&input, load); - } - - UNIT_ASSERT_EQUAL_C(expected, load, "expected: " << expected << ", got: " << load); - } -} +#include <util/stream/buffer.h> +#include <util/generic/buffer.h> +#include <util/ysaveload.h> + +Y_UNIT_TEST_SUITE(JsonSaveLoad) { + Y_UNIT_TEST(Serialize) { + + NJson::TJsonValue expected; + + expected["ui64"] = ui64(1); + expected["i64"] = i64(2); + expected["double"] = 2.0; + expected["string"] = "text"; + expected["map"] = expected; + expected["array"].SetType(NJson::JSON_ARRAY).GetArraySafe().emplace_back(expected); + expected["null"].SetType(NJson::JSON_NULL); + expected["undefined"].SetType(NJson::JSON_UNDEFINED); + + TBuffer buffer; + { + TBufferOutput output(buffer); + ::Save(&output, expected); + } + + NJson::TJsonValue load; + { + TBufferInput input(buffer); + ::Load(&input, load); + } + + UNIT_ASSERT_EQUAL_C(expected, load, "expected: " << expected << ", got: " << load); + } +} |