aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/deprecated/split/delim_string_iter_ut.cpp
diff options
context:
space:
mode:
authoryuliy <yuliy@yandex-team.ru>2022-02-10 16:50:10 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:10 +0300
commit9991a6195dee8db26aa7e2f5f21549fb20e25002 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/deprecated/split/delim_string_iter_ut.cpp
parentdf5f2b17d65c239ec8d68fdf518fcbea2bcc0bfe (diff)
downloadydb-9991a6195dee8db26aa7e2f5f21549fb20e25002.tar.gz
Restoring authorship annotation for <yuliy@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/deprecated/split/delim_string_iter_ut.cpp')
-rw-r--r--library/cpp/deprecated/split/delim_string_iter_ut.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/library/cpp/deprecated/split/delim_string_iter_ut.cpp b/library/cpp/deprecated/split/delim_string_iter_ut.cpp
index a0ec436186..18a8b2a160 100644
--- a/library/cpp/deprecated/split/delim_string_iter_ut.cpp
+++ b/library/cpp/deprecated/split/delim_string_iter_ut.cpp
@@ -50,50 +50,50 @@ Y_UNIT_TEST_SUITE(TDelimStrokaIterTestSuite) {
UNIT_ASSERT_EQUAL(got, expected);
}
}
-
-static void AssertKeyValueStringSplit(
+
+static void AssertKeyValueStringSplit(
const TStringBuf str,
const TStringBuf delim,
const TVector<std::pair<TStringBuf, TStringBuf>>& expected) {
TKeyValueDelimStringIter it(str, delim);
-
- for (const auto& expectedKeyValue : expected) {
- UNIT_ASSERT(it.Valid());
- UNIT_ASSERT_STRINGS_EQUAL(it.Key(), expectedKeyValue.first);
- UNIT_ASSERT_STRINGS_EQUAL(it.Value(), expectedKeyValue.second);
- ++it;
- }
- UNIT_ASSERT(!it.Valid());
-}
-
+
+ for (const auto& expectedKeyValue : expected) {
+ UNIT_ASSERT(it.Valid());
+ UNIT_ASSERT_STRINGS_EQUAL(it.Key(), expectedKeyValue.first);
+ UNIT_ASSERT_STRINGS_EQUAL(it.Value(), expectedKeyValue.second);
+ ++it;
+ }
+ UNIT_ASSERT(!it.Valid());
+}
+
Y_UNIT_TEST_SUITE(TKeyValueDelimStringIterTestSuite) {
Y_UNIT_TEST(SingleCharacterAsDelimiter) {
- AssertKeyValueStringSplit(
- "abc=123,cde=qwer", ",",
+ AssertKeyValueStringSplit(
+ "abc=123,cde=qwer", ",",
{{"abc", "123"},
{"cde", "qwer"}});
- }
-
+ }
+
Y_UNIT_TEST(MultipleCharactersAsDelimiter) {
- AssertKeyValueStringSplit(
- "abc=xyz@@qwerty=zxcv", "@@",
+ AssertKeyValueStringSplit(
+ "abc=xyz@@qwerty=zxcv", "@@",
{{"abc", "xyz"},
{"qwerty", "zxcv"}});
- }
-
+ }
+
Y_UNIT_TEST(NoDelimiters) {
- AssertKeyValueStringSplit(
- "abc=zz", ",",
+ AssertKeyValueStringSplit(
+ "abc=zz", ",",
{{"abc", "zz"}});
- }
-
+ }
+
Y_UNIT_TEST(EmptyElements) {
- AssertKeyValueStringSplit(
- "@@abc=zxy@@@@qwerty=y@@", "@@",
+ AssertKeyValueStringSplit(
+ "@@abc=zxy@@@@qwerty=y@@", "@@",
{{"", ""},
{"abc", "zxy"},
{"", ""},
{"qwerty", "y"},
{"", ""}});
- }
-}
+ }
+}