diff options
author | ivanmorozov <ivanmorozov@yandex-team.ru> | 2022-02-10 16:47:34 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:34 +0300 |
commit | 464ba3814a83db4f2d5327393b0b6eaf0c86bfd7 (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /util/folder/path_ut.cpp | |
parent | cba5d9a444e2cfe105f55ccda66cd21d50440017 (diff) | |
download | ydb-464ba3814a83db4f2d5327393b0b6eaf0c86bfd7.tar.gz |
Restoring authorship annotation for <ivanmorozov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/folder/path_ut.cpp')
-rw-r--r-- | util/folder/path_ut.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/util/folder/path_ut.cpp b/util/folder/path_ut.cpp index e6a42f2e09..e6a3451016 100644 --- a/util/folder/path_ut.cpp +++ b/util/folder/path_ut.cpp @@ -56,36 +56,36 @@ namespace { Y_UNIT_TEST_SUITE(TFsPathTests) { Y_UNIT_TEST(TestMkDirs) { - const TFsPath path = "a/b/c/d/e/f"; - path.ForceDelete(); - TFsPath current = path; - ui32 checksCounter = 0; - while (current != ".") { - UNIT_ASSERT(!path.Exists()); - ++checksCounter; - current = current.Parent(); - } + const TFsPath path = "a/b/c/d/e/f"; + path.ForceDelete(); + TFsPath current = path; + ui32 checksCounter = 0; + while (current != ".") { + UNIT_ASSERT(!path.Exists()); + ++checksCounter; + current = current.Parent(); + } UNIT_ASSERT_VALUES_EQUAL(checksCounter, 6); - - path.MkDirs(); - UNIT_ASSERT(path.Exists()); - - current = path; - while (current != ".") { - UNIT_ASSERT(path.Exists()); - current = current.Parent(); - } - } - + + path.MkDirs(); + UNIT_ASSERT(path.Exists()); + + current = path; + while (current != ".") { + UNIT_ASSERT(path.Exists()); + current = current.Parent(); + } + } + Y_UNIT_TEST(MkDirFreak) { - TFsPath path; + TFsPath path; UNIT_ASSERT_EXCEPTION(path.MkDir(), TIoException); UNIT_ASSERT_EXCEPTION(path.MkDirs(), TIoException); - path = "."; - path.MkDir(); - path.MkDirs(); - } - + path = "."; + path.MkDir(); + path.MkDirs(); + } + Y_UNIT_TEST(Parent) { #ifdef _win_ UNIT_ASSERT_VALUES_EQUAL(TFsPath("\\etc/passwd").Parent(), TFsPath("\\etc")); @@ -149,25 +149,25 @@ Y_UNIT_TEST_SUITE(TFsPathTests) { } Y_UNIT_TEST(TestForceRename) { - TTestDirectory xx("TestForceRename"); - TFsPath fMain = xx.Child("main"); - - TFsPath f1 = fMain.Child("f1"); - f1.MkDirs(); - TFsPath f1Child = f1.Child("f1child"); - f1Child.Touch(); - - TFsPath f2 = fMain.Child("f2"); - f2.MkDirs(); - - fMain.ForceRenameTo("TestForceRename/main1"); - - UNIT_ASSERT(!xx.Child("main").Exists()); - UNIT_ASSERT(xx.Child("main1").Child("f1").Exists()); - UNIT_ASSERT(xx.Child("main1").Child("f2").Exists()); - UNIT_ASSERT(xx.Child("main1").Child("f1").Child("f1child").Exists()); - } - + TTestDirectory xx("TestForceRename"); + TFsPath fMain = xx.Child("main"); + + TFsPath f1 = fMain.Child("f1"); + f1.MkDirs(); + TFsPath f1Child = f1.Child("f1child"); + f1Child.Touch(); + + TFsPath f2 = fMain.Child("f2"); + f2.MkDirs(); + + fMain.ForceRenameTo("TestForceRename/main1"); + + UNIT_ASSERT(!xx.Child("main").Exists()); + UNIT_ASSERT(xx.Child("main1").Child("f1").Exists()); + UNIT_ASSERT(xx.Child("main1").Child("f2").Exists()); + UNIT_ASSERT(xx.Child("main1").Child("f1").Child("f1child").Exists()); + } + Y_UNIT_TEST(TestRenameFail) { UNIT_ASSERT_EXCEPTION(TFsPath("sfsfsfsdfsfsdfdf").RenameTo("sdfsdf"), TIoException); } |