diff options
author | familom <[email protected]> | 2022-02-10 16:49:49 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:49 +0300 |
commit | 9c61d3a2cac2a16341e82c613b030fcc03bf277a (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/json/ut/json_writer_ut.cpp | |
parent | f281aaf77179d27d6208b873e95ae6cd45765a63 (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 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 f9f44ed34e2..ca11d34dad9 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}"; |