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
commit5ab412f19b9312abbfa362391df45d6603bb84c3 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/json
parentaffdafdb1fc09bf0bfc384355143ee6db9e90046 (diff)
downloadydb-5ab412f19b9312abbfa362391df45d6603bb84c3.tar.gz
Restoring authorship annotation for <jimmy@yandex-team.ru>. Commit 2 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 2c838d243f..ca11d34dad 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 268722fe66..02370c2d79 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 e6693feb68..0aae2531b9 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 0c706e9305..9980555683 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());