diff options
| author | jimmy <[email protected]> | 2022-02-10 16:49:38 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:38 +0300 | 
| commit | affdafdb1fc09bf0bfc384355143ee6db9e90046 (patch) | |
| tree | da80bda4720043db2e41dfd1c7fd04de32021fd3 /library/cpp/json | |
| parent | 4e4faf8d95a4916a49f6674f3ff50e13799fbaa6 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/json')
| -rw-r--r-- | library/cpp/json/ut/json_writer_ut.cpp | 24 | ||||
| -rw-r--r-- | library/cpp/json/writer/json.cpp | 4 | ||||
| -rw-r--r-- | library/cpp/json/writer/json.h | 2 | ||||
| -rw-r--r-- | library/cpp/json/writer/json_ut.cpp | 4 | 
4 files changed, 17 insertions, 17 deletions
| diff --git a/library/cpp/json/ut/json_writer_ut.cpp b/library/cpp/json/ut/json_writer_ut.cpp index ca11d34dad9..2c838d243f7 100644 --- a/library/cpp/json/ut/json_writer_ut.cpp +++ b/library/cpp/json/ut/json_writer_ut.cpp @@ -57,18 +57,18 @@ Y_UNIT_TEST_SUITE(TJsonWriterTest) {      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; -        v["key1"] = JSON_NULL; -        v["key2"]["subkey1"].AppendValue(1); -        v["key2"]["subkey1"].AppendValue(JSON_MAP)["subsubkey"] = "test2"; -        v["key2"]["subkey1"].AppendValue(JSON_NULL); -        v["key2"]["subkey1"].AppendValue(true); -        v["key2"]["subkey2"] = "test"; -        TStringStream out; -        WriteJson(&out, &v, true); -        UNIT_ASSERT_STRINGS_EQUAL(out.Str(), expected); -    } - +        TJsonValue v;  +        v["key1"] = JSON_NULL;  +        v["key2"]["subkey1"].AppendValue(1);  +        v["key2"]["subkey1"].AppendValue(JSON_MAP)["subsubkey"] = "test2";  +        v["key2"]["subkey1"].AppendValue(JSON_NULL);  +        v["key2"]["subkey1"].AppendValue(true);  +        v["key2"]["subkey2"] = "test";  +        TStringStream out;  +        WriteJson(&out, &v, true);  +        UNIT_ASSERT_STRINGS_EQUAL(out.Str(), expected);  +    }  +       Y_UNIT_TEST(SortKeys) {          TString expected = "{\"a\":null,\"j\":null,\"n\":null,\"y\":null,\"z\":null}";          TJsonValue v; diff --git a/library/cpp/json/writer/json.cpp b/library/cpp/json/writer/json.cpp index 02370c2d79e..268722fe668 100644 --- a/library/cpp/json/writer/json.cpp +++ b/library/cpp/json/writer/json.cpp @@ -136,12 +136,12 @@ namespace NJsonWriter {          NeedComma = false;          NeedNewline = false;      } - +       inline void TBuf::EndValue() {          if (StackTop() == JE_PAIR) {              StackPop();          } -    } +    }       TValueContext TBuf::BeginList() {          NeedNewline = true; diff --git a/library/cpp/json/writer/json.h b/library/cpp/json/writer/json.h index 0aae2531b94..e6693feb685 100644 --- a/library/cpp/json/writer/json.h +++ b/library/cpp/json/writer/json.h @@ -152,7 +152,7 @@ namespace NJsonWriter {          TVector<EJsonEntity> Stack;          bool NeedComma; -        bool NeedNewline; +        bool NeedNewline;           const EHtmlEscapeMode EscapeMode;          int IndentSpaces;          bool WriteNanAsString; diff --git a/library/cpp/json/writer/json_ut.cpp b/library/cpp/json/writer/json_ut.cpp index 9980555683f..0c706e93056 100644 --- a/library/cpp/json/writer/json_ut.cpp +++ b/library/cpp/json/writer/json_ut.cpp @@ -118,8 +118,8 @@ Y_UNIT_TEST_SUITE(JsonWriter) {                            "  1,\n"                            "  \"hello\",\n"                            "  {\n" -                          "    \"abc\":3,\n" -                          "    \"def\":4\n" +                          "    \"abc\":3,\n"  +                          "    \"def\":4\n"                             "  }\n"                            "]";          UNIT_ASSERT_STRINGS_EQUAL(exp, w.Str()); | 
