aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/json/writer/json_ut.cpp
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:23 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:23 +0300
commit706b83ed7de5a473436620367af31fc0ceecde07 (patch)
tree103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/json/writer/json_ut.cpp
parent918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff)
downloadydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/json/writer/json_ut.cpp')
-rw-r--r--library/cpp/json/writer/json_ut.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/cpp/json/writer/json_ut.cpp b/library/cpp/json/writer/json_ut.cpp
index 9980555683..a05d39f0a9 100644
--- a/library/cpp/json/writer/json_ut.cpp
+++ b/library/cpp/json/writer/json_ut.cpp
@@ -32,14 +32,14 @@ Y_UNIT_TEST_SUITE(JsonWriter) {
Y_UNIT_TEST(EscapedString) {
NJsonWriter::TBuf w(NJsonWriter::HEM_ESCAPE_HTML);
w.WriteString(" \n \r \t \007 \b \f ' <tag> &ent; \"txt\" ");
- TString ws = w.Str();
+ TString ws = w.Str();
const char* exp = "\" \\n \\r \\t \\u0007 \\b \\f &#39; &lt;tag&gt; &amp;ent; &quot;txt&quot; \"";
UNIT_ASSERT_STRINGS_EQUAL(ws.c_str(), exp);
}
Y_UNIT_TEST(UnescapedString) {
NJsonWriter::TBuf w;
w.WriteString(" \n \r \t \b \f '; -- <tag> &ent; \"txt\"", NJsonWriter::HEM_DONT_ESCAPE_HTML);
- TString ws = w.Str();
+ TString ws = w.Str();
const char* exp = "\" \\n \\r \\t \\b \\f \\u0027; -- \\u003Ctag\\u003E &ent; \\\"txt\\\"\"";
UNIT_ASSERT_STRINGS_EQUAL(ws.c_str(), exp);
}
@@ -48,12 +48,12 @@ Y_UNIT_TEST_SUITE(JsonWriter) {
w.UnsafeWriteRawBytes("(", 1);
w.BeginList().WriteString("<>&'\\").BeginList();
w.EndList().EndList();
- TString ws = w.Str();
+ TString ws = w.Str();
const char* exp = "([\"\\u003C\\u003E&\\u0027\\\\\",[]]";
UNIT_ASSERT_STRINGS_EQUAL(ws.c_str(), exp);
}
Y_UNIT_TEST(Utf8) {
- TString ws = NJsonWriter::TBuf().WriteString("яЯ σΣ ש א").Str();
+ TString ws = NJsonWriter::TBuf().WriteString("яЯ σΣ ש א").Str();
const char* exp = "\"яЯ σΣ ש א\"";
UNIT_ASSERT_STRINGS_EQUAL(ws.c_str(), exp);
}
@@ -80,14 +80,14 @@ Y_UNIT_TEST_SUITE(JsonWriter) {
.CompatWriteKeyWithoutQuotes("n")
.WriteInt(0)
.EndObject();
- TString ws = w.Str();
+ TString ws = w.Str();
const char* exp = "{p:1,n:0}";
UNIT_ASSERT_STRINGS_EQUAL(ws.c_str(), exp);
}
Y_UNIT_TEST(UnescapedStringInObject) {
NJsonWriter::TBuf w(NJsonWriter::HEM_DONT_ESCAPE_HTML);
w.BeginObject().WriteKey("key").WriteString("</&>'").EndObject();
- TString ws = w.Str();
+ TString ws = w.Str();
const char* exp = "{\"key\":\"\\u003C\\/&\\u003E\\u0027\"}";
UNIT_ASSERT_STRINGS_EQUAL(ws.c_str(), exp);
}