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 /util/string/subst_ut.cpp | |
parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
download | ydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string/subst_ut.cpp')
-rw-r--r-- | util/string/subst_ut.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/util/string/subst_ut.cpp b/util/string/subst_ut.cpp index fc88469ceb..21eccef779 100644 --- a/util/string/subst_ut.cpp +++ b/util/string/subst_ut.cpp @@ -4,7 +4,7 @@ #include <library/cpp/testing/unittest/registar.h> -Y_UNIT_TEST_SUITE(TStringSubst) { +Y_UNIT_TEST_SUITE(TStringSubst) { static const size_t MIN_FROM_CTX = 4; static const TVector<TString> ALL_FROM{TString("F"), TString("FF")}; static const TVector<TString> ALL_TO{TString(""), TString("T"), TString("TT"), TString("TTT")}; @@ -24,7 +24,7 @@ Y_UNIT_TEST_SUITE(TStringSubst) { } } - Y_UNIT_TEST(TestSubstGlobalNoSubstA) { + Y_UNIT_TEST(TestSubstGlobalNoSubstA) { for (const auto& from : ALL_FROM) { const size_t fromSz = from.size(); const size_t minSz = fromSz; @@ -40,7 +40,7 @@ Y_UNIT_TEST_SUITE(TStringSubst) { } } - Y_UNIT_TEST(TestSubstGlobalNoSubstB) { + Y_UNIT_TEST(TestSubstGlobalNoSubstB) { for (const auto& from : ALL_FROM) { const size_t fromSz = from.size(); const size_t minSz = fromSz; @@ -103,23 +103,23 @@ Y_UNIT_TEST_SUITE(TStringSubst) { } } - Y_UNIT_TEST(TestSubstGlobalSubst1) { + Y_UNIT_TEST(TestSubstGlobalSubst1) { DoTestSubstGlobal(1); } - Y_UNIT_TEST(TestSubstGlobalSubst2) { + Y_UNIT_TEST(TestSubstGlobalSubst2) { DoTestSubstGlobal(2); } - Y_UNIT_TEST(TestSubstGlobalSubst3) { + Y_UNIT_TEST(TestSubstGlobalSubst3) { DoTestSubstGlobal(3); } - Y_UNIT_TEST(TestSubstGlobalSubst4) { + Y_UNIT_TEST(TestSubstGlobalSubst4) { DoTestSubstGlobal(4); } - Y_UNIT_TEST(TestSubstGlobalOld) { + Y_UNIT_TEST(TestSubstGlobalOld) { TString s; s = "aaa"; SubstGlobal(s, "a", "bb"); @@ -160,7 +160,7 @@ Y_UNIT_TEST_SUITE(TStringSubst) { UNIT_ASSERT_EQUAL(s10, TString("Москва Париж")); } - Y_UNIT_TEST(TestSubstCharGlobal) { + Y_UNIT_TEST(TestSubstCharGlobal) { TUtf16String w = u"abcdabcd"; SubstGlobal(w, wchar16('b'), wchar16('B'), 3); UNIT_ASSERT_EQUAL(w, u"abcdaBcd"); @@ -180,74 +180,74 @@ Y_UNIT_TEST_SUITE(TStringSubst) { UNIT_ASSERT_EQUAL(s2, TString("abb")); } - Y_UNIT_TEST(TestSubstStdString) { + Y_UNIT_TEST(TestSubstStdString) { std::string s = "aaa"; SubstGlobal(s, "a", "b", 1); UNIT_ASSERT_EQUAL(s, "abb"); } - + Y_UNIT_TEST(TestSubstStdStringRet) { const std::string s1 = "aaa"; const std::string s2 = SubstGlobalCopy(s1, "a", "b", 1); UNIT_ASSERT_EQUAL(s2, "abb"); } - Y_UNIT_TEST(TestSubstGlobalChar) { - { + Y_UNIT_TEST(TestSubstGlobalChar) { + { const TString s = "a"; const TString st = "b"; TString ss = s; - UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); - UNIT_ASSERT_VALUES_EQUAL(st, ss); - } - { + UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); + UNIT_ASSERT_VALUES_EQUAL(st, ss); + } + { const TString s = "aa"; const TString st = "bb"; TString ss = s; - UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); - UNIT_ASSERT_VALUES_EQUAL(st, ss); - } - { + UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); + UNIT_ASSERT_VALUES_EQUAL(st, ss); + } + { const TString s = "aaa"; const TString st = "bbb"; TString ss = s; - UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); - UNIT_ASSERT_VALUES_EQUAL(st, ss); - } - { + UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); + UNIT_ASSERT_VALUES_EQUAL(st, ss); + } + { const TString s = "aaaa"; const TString st = "bbbb"; TString ss = s; - UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); - UNIT_ASSERT_VALUES_EQUAL(st, ss); - } - { + UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); + UNIT_ASSERT_VALUES_EQUAL(st, ss); + } + { const TString s = "aaaaa"; const TString st = "bbbbb"; TString ss = s; - UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); - UNIT_ASSERT_VALUES_EQUAL(st, ss); - } - { + UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); + UNIT_ASSERT_VALUES_EQUAL(st, ss); + } + { const TString s = "aaaaaa"; const TString st = "bbbbbb"; TString ss = s; - UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); - UNIT_ASSERT_VALUES_EQUAL(st, ss); - } - { + UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); + UNIT_ASSERT_VALUES_EQUAL(st, ss); + } + { const TString s = "aaaaaaa"; const TString st = "bbbbbbb"; TString ss = s; - UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); - UNIT_ASSERT_VALUES_EQUAL(st, ss); - } - { + UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); + UNIT_ASSERT_VALUES_EQUAL(st, ss); + } + { const TString s = "aaaaaaaa"; const TString st = "bbbbbbbb"; TString ss = s; - UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); - UNIT_ASSERT_VALUES_EQUAL(st, ss); - } - } + UNIT_ASSERT_VALUES_EQUAL(s.size(), SubstGlobal(ss, 'a', 'b')); + UNIT_ASSERT_VALUES_EQUAL(st, ss); + } + } } |