aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/json
diff options
context:
space:
mode:
authorjimmy <jimmy@yandex-team.ru>2022-02-10 16:49:38 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:38 +0300
commitaffdafdb1fc09bf0bfc384355143ee6db9e90046 (patch)
treeda80bda4720043db2e41dfd1c7fd04de32021fd3 /library/cpp/json
parent4e4faf8d95a4916a49f6674f3ff50e13799fbaa6 (diff)
downloadydb-affdafdb1fc09bf0bfc384355143ee6db9e90046.tar.gz
Restoring authorship annotation for <jimmy@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/json')
-rw-r--r--library/cpp/json/ut/json_writer_ut.cpp24
-rw-r--r--library/cpp/json/writer/json.cpp4
-rw-r--r--library/cpp/json/writer/json.h2
-rw-r--r--library/cpp/json/writer/json_ut.cpp4
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 ca11d34dad..2c838d243f 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 02370c2d79..268722fe66 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 0aae2531b9..e6693feb68 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 9980555683..0c706e9305 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());