diff options
author | stanly <stanly@yandex-team.ru> | 2022-02-10 16:46:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:49 +0300 |
commit | 6170310e8721e225f64ddabf7a7358253d7a1249 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /util/folder/iterator_ut.cpp | |
parent | cde218e65dfef5ce03a48d641fd8f7913cf17b2d (diff) | |
download | ydb-6170310e8721e225f64ddabf7a7358253d7a1249.tar.gz |
Restoring authorship annotation for <stanly@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/folder/iterator_ut.cpp')
-rw-r--r-- | util/folder/iterator_ut.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/util/folder/iterator_ut.cpp b/util/folder/iterator_ut.cpp index 9a3f92313f..936becd139 100644 --- a/util/folder/iterator_ut.cpp +++ b/util/folder/iterator_ut.cpp @@ -22,7 +22,7 @@ class TDirIteratorTest: public TTestBase { UNIT_TEST(TestIt) UNIT_TEST(TestError) UNIT_TEST(TestLocal) - UNIT_TEST(TestSkip) + UNIT_TEST(TestSkip) UNIT_TEST(TestSort) UNIT_TEST_SUITE_END(); @@ -134,45 +134,45 @@ private: } } - inline void TestSkip() { - TDirHier hier; - - const TString dir = "tmpdir"; - const TDirHier::TPath path = {dir, 1}; - - hier.Add(path); - hier.AddDir(dir + LOCSLASH_C + "dir1"); - hier.AddDir(dir + LOCSLASH_C + "dir1" + LOCSLASH_C + "dir2"); - // - // Without skip - // - { - TDirIterator di(dir); - - UNIT_ASSERT(di.Next()); - UNIT_ASSERT_EQUAL(TStringBuf(di.Next()->fts_name), "dir1"); - UNIT_ASSERT_EQUAL(TStringBuf(di.Next()->fts_name), "dir2"); - UNIT_ASSERT_EQUAL(TStringBuf(di.Next()->fts_name), "dir2"); - UNIT_ASSERT_EQUAL(TStringBuf(di.Next()->fts_name), "dir1"); - UNIT_ASSERT(di.Next()); - UNIT_ASSERT_EQUAL(di.Next(), nullptr); - } - // - // With skip - // - { - TDirIterator di(dir); - - UNIT_ASSERT(di.Next()); - auto ent = di.Next(); - UNIT_ASSERT_EQUAL(TStringBuf(ent->fts_name), "dir1"); - di.Skip(ent); - UNIT_ASSERT_EQUAL(TStringBuf(di.Next()->fts_name), "dir1"); - UNIT_ASSERT(di.Next()); - UNIT_ASSERT_EQUAL(di.Next(), nullptr); - } - } - + inline void TestSkip() { + TDirHier hier; + + const TString dir = "tmpdir"; + const TDirHier::TPath path = {dir, 1}; + + hier.Add(path); + hier.AddDir(dir + LOCSLASH_C + "dir1"); + hier.AddDir(dir + LOCSLASH_C + "dir1" + LOCSLASH_C + "dir2"); + // + // Without skip + // + { + TDirIterator di(dir); + + UNIT_ASSERT(di.Next()); + UNIT_ASSERT_EQUAL(TStringBuf(di.Next()->fts_name), "dir1"); + UNIT_ASSERT_EQUAL(TStringBuf(di.Next()->fts_name), "dir2"); + UNIT_ASSERT_EQUAL(TStringBuf(di.Next()->fts_name), "dir2"); + UNIT_ASSERT_EQUAL(TStringBuf(di.Next()->fts_name), "dir1"); + UNIT_ASSERT(di.Next()); + UNIT_ASSERT_EQUAL(di.Next(), nullptr); + } + // + // With skip + // + { + TDirIterator di(dir); + + UNIT_ASSERT(di.Next()); + auto ent = di.Next(); + UNIT_ASSERT_EQUAL(TStringBuf(ent->fts_name), "dir1"); + di.Skip(ent); + UNIT_ASSERT_EQUAL(TStringBuf(di.Next()->fts_name), "dir1"); + UNIT_ASSERT(di.Next()); + UNIT_ASSERT_EQUAL(di.Next(), nullptr); + } + } + inline void TestSort() { TDirHier dh; const TString dir("tmpdir"); |