aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/html/pcdata/pcdata_ut.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/html/pcdata/pcdata_ut.cpp
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/html/pcdata/pcdata_ut.cpp')
-rw-r--r--library/cpp/html/pcdata/pcdata_ut.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/library/cpp/html/pcdata/pcdata_ut.cpp b/library/cpp/html/pcdata/pcdata_ut.cpp
index 5833f8bc59..7418ecf11e 100644
--- a/library/cpp/html/pcdata/pcdata_ut.cpp
+++ b/library/cpp/html/pcdata/pcdata_ut.cpp
@@ -1,36 +1,36 @@
-#include "pcdata.h"
-
+#include "pcdata.h"
+
#include <library/cpp/testing/unittest/registar.h>
-
+
Y_UNIT_TEST_SUITE(TPcdata) {
Y_UNIT_TEST(TestStress) {
- {
- ui64 key = 0x000017C0B76C4E87ull;
+ {
+ ui64 key = 0x000017C0B76C4E87ull;
TString res = EncodeHtmlPcdata(TStringBuf((const char*)&key, sizeof(key)));
- }
-
- for (size_t i = 0; i < 1000; ++i) {
+ }
+
+ for (size_t i = 0; i < 1000; ++i) {
const TString s = NUnitTest::RandomString(i, i);
-
- UNIT_ASSERT_VALUES_EQUAL(DecodeHtmlPcdata(EncodeHtmlPcdata(s)), s);
- }
- }
-
+
+ UNIT_ASSERT_VALUES_EQUAL(DecodeHtmlPcdata(EncodeHtmlPcdata(s)), s);
+ }
+ }
+
Y_UNIT_TEST(Test1) {
const TString tests[] = {
- "qw&qw",
- "&<",
- ">&qw",
- "\'&aaa"};
-
+ "qw&qw",
+ "&<",
+ ">&qw",
+ "\'&aaa"};
+
for (auto s : tests) {
- UNIT_ASSERT_VALUES_EQUAL(DecodeHtmlPcdata(EncodeHtmlPcdata(s)), s);
- }
- }
-
+ UNIT_ASSERT_VALUES_EQUAL(DecodeHtmlPcdata(EncodeHtmlPcdata(s)), s);
+ }
+ }
+
Y_UNIT_TEST(Test2) {
- UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("&qqq"), "&amp;qqq");
- }
+ UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("&qqq"), "&amp;qqq");
+ }
Y_UNIT_TEST(TestEncodeHtmlPcdataAppend) {
TString s;
@@ -41,8 +41,8 @@ Y_UNIT_TEST_SUITE(TPcdata) {
}
Y_UNIT_TEST(TestStrangeAmpParameter) {
- UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's", true), "m&amp;m&#39;s");
- UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's"), "m&amp;m&#39;s"); //default
+ UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's", true), "m&amp;m&#39;s");
+ UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's"), "m&amp;m&#39;s"); //default
UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's", false), "m&m&#39;s");
}
-}
+}