diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
commit | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/html | |
parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
download | ydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/html')
-rw-r--r-- | library/cpp/html/escape/ut/escape_ut.cpp | 4 | ||||
-rw-r--r-- | library/cpp/html/pcdata/pcdata.cpp | 2 | ||||
-rw-r--r-- | library/cpp/html/pcdata/pcdata.h | 2 | ||||
-rw-r--r-- | library/cpp/html/pcdata/pcdata_ut.cpp | 14 |
4 files changed, 11 insertions, 11 deletions
diff --git a/library/cpp/html/escape/ut/escape_ut.cpp b/library/cpp/html/escape/ut/escape_ut.cpp index 7a28d7c12b..cd7b955138 100644 --- a/library/cpp/html/escape/ut/escape_ut.cpp +++ b/library/cpp/html/escape/ut/escape_ut.cpp @@ -3,8 +3,8 @@ using namespace NHtml; -Y_UNIT_TEST_SUITE(TEscapeHtml) { - Y_UNIT_TEST(Escape) { +Y_UNIT_TEST_SUITE(TEscapeHtml) { + Y_UNIT_TEST(Escape) { UNIT_ASSERT_EQUAL(EscapeText("in & out"), "in & out"); UNIT_ASSERT_EQUAL(EscapeText("&&"), "&&"); UNIT_ASSERT_EQUAL(EscapeText("&"), "&amp;"); diff --git a/library/cpp/html/pcdata/pcdata.cpp b/library/cpp/html/pcdata/pcdata.cpp index 7cc0f6da85..740c240fd2 100644 --- a/library/cpp/html/pcdata/pcdata.cpp +++ b/library/cpp/html/pcdata/pcdata.cpp @@ -61,7 +61,7 @@ TString EncodeHtmlPcdata(const TStringBuf str, bool qAmp) { TString DecodeHtmlPcdata(const TString& sz) { TString res; - const char* codes[] = {""", "<", ">", "'", "'", "&", "'", nullptr}; + const char* codes[] = {""", "<", ">", "'", "'", "&", "'", nullptr}; const char chars[] = {'\"', '<', '>', '\'', '\'', '&', '\''}; for (size_t i = 0; i < sz.length(); ++i) { char c = sz[i]; diff --git a/library/cpp/html/pcdata/pcdata.h b/library/cpp/html/pcdata/pcdata.h index 786e98ac02..7dd741f53d 100644 --- a/library/cpp/html/pcdata/pcdata.h +++ b/library/cpp/html/pcdata/pcdata.h @@ -1,6 +1,6 @@ #pragma once -#include <util/generic/fwd.h> +#include <util/generic/fwd.h> /// Converts a text into HTML-code. Special characters of HTML («<», «>», ...) replaced with entities. TString EncodeHtmlPcdata(const TStringBuf str, bool qAmp = true); diff --git a/library/cpp/html/pcdata/pcdata_ut.cpp b/library/cpp/html/pcdata/pcdata_ut.cpp index 90088712e2..5833f8bc59 100644 --- a/library/cpp/html/pcdata/pcdata_ut.cpp +++ b/library/cpp/html/pcdata/pcdata_ut.cpp @@ -2,8 +2,8 @@ #include <library/cpp/testing/unittest/registar.h> -Y_UNIT_TEST_SUITE(TPcdata) { - Y_UNIT_TEST(TestStress) { +Y_UNIT_TEST_SUITE(TPcdata) { + Y_UNIT_TEST(TestStress) { { ui64 key = 0x000017C0B76C4E87ull; TString res = EncodeHtmlPcdata(TStringBuf((const char*)&key, sizeof(key))); @@ -16,23 +16,23 @@ Y_UNIT_TEST_SUITE(TPcdata) { } } - Y_UNIT_TEST(Test1) { + Y_UNIT_TEST(Test1) { const TString tests[] = { "qw&qw", "&<", ">&qw", "\'&aaa"}; - for (auto s : tests) { + for (auto s : tests) { UNIT_ASSERT_VALUES_EQUAL(DecodeHtmlPcdata(EncodeHtmlPcdata(s)), s); } } - Y_UNIT_TEST(Test2) { + Y_UNIT_TEST(Test2) { UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("&qqq"), "&qqq"); } - Y_UNIT_TEST(TestEncodeHtmlPcdataAppend) { + Y_UNIT_TEST(TestEncodeHtmlPcdataAppend) { TString s; EncodeHtmlPcdataAppend("m&m", s); EncodeHtmlPcdataAppend("'s", s); @@ -40,7 +40,7 @@ Y_UNIT_TEST_SUITE(TPcdata) { UNIT_ASSERT_VALUES_EQUAL("m&m's", s); } - Y_UNIT_TEST(TestStrangeAmpParameter) { + Y_UNIT_TEST(TestStrangeAmpParameter) { UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's", true), "m&m's"); UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's"), "m&m's"); //default UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's", false), "m&m's"); |