From e21d5670f181bded7a3222fe235c79bea9d9f378 Mon Sep 17 00:00:00 2001 From: avatar Date: Thu, 10 Feb 2022 16:50:10 +0300 Subject: Restoring authorship annotation for . Commit 1 of 2. --- .../cpp/deprecated/split/delim_string_iter_ut.cpp | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'library/cpp/deprecated') diff --git a/library/cpp/deprecated/split/delim_string_iter_ut.cpp b/library/cpp/deprecated/split/delim_string_iter_ut.cpp index 18a8b2a1604..eb88fa927e2 100644 --- a/library/cpp/deprecated/split/delim_string_iter_ut.cpp +++ b/library/cpp/deprecated/split/delim_string_iter_ut.cpp @@ -1,35 +1,35 @@ #include "delim_string_iter.h" -#include +#include #include - + /// Test that TDelimStringIter build on top of given string and delimeter will produce expected sequence static void AssertStringSplit(const TString& str, const TString& delim, const TVector& expected) { TDelimStringIter it(str, delim); - - // test iterator invariants - for (const auto& expectedString : expected) { - UNIT_ASSERT(it.Valid()); + + // test iterator invariants + for (const auto& expectedString : expected) { + UNIT_ASSERT(it.Valid()); UNIT_ASSERT(bool(it)); UNIT_ASSERT_STRINGS_EQUAL(it->ToString(), expectedString); - ++it; - } - UNIT_ASSERT(!it.Valid()); -}; - + ++it; + } + UNIT_ASSERT(!it.Valid()); +}; + Y_UNIT_TEST_SUITE(TDelimStrokaIterTestSuite) { Y_UNIT_TEST(SingleCharacterAsDelimiter) { - AssertStringSplit( + AssertStringSplit( "Hello words!", " ", {"Hello", "words!"}); - } - + } + Y_UNIT_TEST(MultipleCharactersAsDelimiter) { - AssertStringSplit( + AssertStringSplit( "0, 1, 1, 2, 3, 5, 8, 13, 21, 34", "1, ", {"0, ", "", "2, 3, 5, 8, 13, 2", "34"}); - } - + } + Y_UNIT_TEST(NoDelimitersPresent) { AssertStringSplit("This string could be yours", "\t", {"This string could be yours"}); - } + } Y_UNIT_TEST(Cdr) { TDelimStringIter it("a\tc\t", "\t"); @@ -49,7 +49,7 @@ Y_UNIT_TEST_SUITE(TDelimStrokaIterTestSuite) { UNIT_ASSERT_EQUAL(got, expected); } -} +} static void AssertKeyValueStringSplit( const TStringBuf str, -- cgit v1.3