Skip to content

Commit b749b9a

Browse files
committed
Fix fstat_ut (#164)
Need to remove the directory at the end of the test
1 parent 1d96b56 commit b749b9a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

util/system/fstat_ut.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,12 @@ Y_UNIT_TEST_SUITE(TestFileStat) {
122122
UNIT_ASSERT_VALUES_EQUAL_C(false, statFollow.IsFile(), ToString(statFollow.Mode));
123123
UNIT_ASSERT_VALUES_EQUAL_C(true, statFollow.IsSymlink(), ToString(statFollow.Mode));
124124
UNIT_ASSERT_VALUES_EQUAL_C(false, statFollow.IsDir(), ToString(statFollow.Mode));
125+
126+
NFs::RemoveRecursive(GetOutputPath());
125127
}
126128

127129
Y_UNIT_TEST(SymlinkToNonExistingFileTest) {
130+
NFs::MakeDirectory(GetOutputPath());
128131
const auto path = GetOutputPath() / "file_2";
129132
const auto link = GetOutputPath() / "symlink_2";
130133
SAFE_SYMLINK(path, link);
@@ -140,9 +143,12 @@ Y_UNIT_TEST_SUITE(TestFileStat) {
140143
UNIT_ASSERT_VALUES_EQUAL_C(false, statFollow.IsFile(), ToString(statFollow.Mode));
141144
UNIT_ASSERT_VALUES_EQUAL_C(true, statFollow.IsSymlink(), ToString(statFollow.Mode));
142145
UNIT_ASSERT_VALUES_EQUAL_C(false, statFollow.IsDir(), ToString(statFollow.Mode));
146+
147+
NFs::RemoveRecursive(GetOutputPath());
143148
}
144149

145150
Y_UNIT_TEST(SymlinkToFileThatCantExistTest) {
151+
NFs::MakeDirectory(GetOutputPath());
146152
const auto path = TFsPath("/path") / "that" / "does" / "not" / "exists";
147153
const auto link = GetOutputPath() / "symlink_3";
148154
SAFE_SYMLINK(path, link);
@@ -158,6 +164,8 @@ Y_UNIT_TEST_SUITE(TestFileStat) {
158164
UNIT_ASSERT_VALUES_EQUAL_C(false, statFollow.IsFile(), ToString(statFollow.Mode));
159165
UNIT_ASSERT_VALUES_EQUAL_C(true, statFollow.IsSymlink(), ToString(statFollow.Mode));
160166
UNIT_ASSERT_VALUES_EQUAL_C(false, statFollow.IsDir(), ToString(statFollow.Mode));
167+
168+
NFs::RemoveRecursive(GetOutputPath());
161169
}
162170

163171
Y_UNIT_TEST(FileDoesNotExistTest) {

0 commit comments

Comments
 (0)