diff options
author | familom <familom@yandex-team.ru> | 2022-02-10 16:49:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:49 +0300 |
commit | f281aaf77179d27d6208b873e95ae6cd45765a63 (patch) | |
tree | b4229c6ece98c855bd9821ef0b656042c29a8953 /library/cpp/json/ut/json_writer_ut.cpp | |
parent | 53d07fb9e28d179add32cd299c9341bf8a231a31 (diff) | |
download | ydb-f281aaf77179d27d6208b873e95ae6cd45765a63.tar.gz |
Restoring authorship annotation for <familom@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/json/ut/json_writer_ut.cpp')
-rw-r--r-- | library/cpp/json/ut/json_writer_ut.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/library/cpp/json/ut/json_writer_ut.cpp b/library/cpp/json/ut/json_writer_ut.cpp index ca11d34dad..f9f44ed34e 100644 --- a/library/cpp/json/ut/json_writer_ut.cpp +++ b/library/cpp/json/ut/json_writer_ut.cpp @@ -54,7 +54,7 @@ Y_UNIT_TEST_SUITE(TJsonWriterTest) { WriteJson(&out, &v); UNIT_ASSERT_VALUES_EQUAL(out.Str(), expected); } - + Y_UNIT_TEST(FormatOutput) { TString expected = "{\n \"key1\":null,\n \"key2\":\n {\n \"subkey1\":\n [\n 1,\n {\n \"subsubkey\":\"test2\"\n },\n null,\n true\n ],\n \"subkey2\":\"test\"\n }\n}"; TJsonValue v; @@ -83,45 +83,45 @@ Y_UNIT_TEST_SUITE(TJsonWriterTest) { } Y_UNIT_TEST(SimpleUnsignedIntegerWriteTest) { - { + { TString expected = "{\"test\":1}"; - TJsonValue v; - v.InsertValue("test", 1ull); - TStringStream out; - WriteJson(&out, &v); - UNIT_ASSERT_VALUES_EQUAL(out.Str(), expected); - } // 1 - - { + TJsonValue v; + v.InsertValue("test", 1ull); + TStringStream out; + WriteJson(&out, &v); + UNIT_ASSERT_VALUES_EQUAL(out.Str(), expected); + } // 1 + + { TString expected = "{\"test\":-1}"; - TJsonValue v; - v.InsertValue("test", -1); - TStringStream out; - WriteJson(&out, &v); - UNIT_ASSERT_VALUES_EQUAL(out.Str(), expected); - } // -1 - - { + TJsonValue v; + v.InsertValue("test", -1); + TStringStream out; + WriteJson(&out, &v); + UNIT_ASSERT_VALUES_EQUAL(out.Str(), expected); + } // -1 + + { TString expected = "{\"test\":18446744073709551615}"; - TJsonValue v; - v.InsertValue("test", 18446744073709551615ull); - TStringStream out; - WriteJson(&out, &v); - UNIT_ASSERT_VALUES_EQUAL(out.Str(), expected); - } // 18446744073709551615 - - { + TJsonValue v; + v.InsertValue("test", 18446744073709551615ull); + TStringStream out; + WriteJson(&out, &v); + UNIT_ASSERT_VALUES_EQUAL(out.Str(), expected); + } // 18446744073709551615 + + { TString expected = "{\"test\":[1,18446744073709551615]}"; - TJsonValue v; - v.InsertValue("test", TJsonValue()); - v["test"].AppendValue(1); - v["test"].AppendValue(18446744073709551615ull); - TStringStream out; - WriteJson(&out, &v); - UNIT_ASSERT_VALUES_EQUAL(out.Str(), expected); - } // 18446744073709551615 + TJsonValue v; + v.InsertValue("test", TJsonValue()); + v["test"].AppendValue(1); + v["test"].AppendValue(18446744073709551615ull); + TStringStream out; + WriteJson(&out, &v); + UNIT_ASSERT_VALUES_EQUAL(out.Str(), expected); + } // 18446744073709551615 } // SimpleUnsignedIntegerWriteTest - + Y_UNIT_TEST(WriteOptionalTest) { { TString expected = "{\"test\":1}"; |