MCPcopy Create free account
hub / github.com/apache/arrow / TestDeleteDir

Method TestDeleteDir

cpp/src/arrow/filesystem/test_util.cc:264–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264void GenericFileSystemTest::TestDeleteDir(FileSystem* fs) {
265 if (have_flaky_directory_tree_deletion()) GTEST_SKIP() << "Flaky directory deletion";
266
267 ASSERT_OK(fs->CreateDir("AB/CD/EF"));
268 ASSERT_OK(fs->CreateDir("AB/GH/IJ"));
269 CreateFile(fs, "AB/abc", "");
270 CreateFile(fs, "AB/CD/def", "");
271 CreateFile(fs, "AB/CD/EF/ghi", "");
272 ASSERT_OK(fs->DeleteDir("AB/CD"));
273 ASSERT_OK(fs->DeleteDir("AB/GH/IJ"));
274
275 AssertAllDirs(fs, {"AB", "AB/GH"});
276 AssertAllFiles(fs, {"AB/abc"});
277
278 // File doesn't exist
279 ASSERT_RAISES(IOError, fs->DeleteDir("AB/GH/IJ"));
280 ASSERT_RAISES(IOError, fs->DeleteDir(""));
281
282 AssertAllDirs(fs, {"AB", "AB/GH"});
283
284 // Not a directory
285 CreateFile(fs, "AB/def", "");
286 ASSERT_RAISES(IOError, fs->DeleteDir("AB/def"));
287
288 AssertAllDirs(fs, {"AB", "AB/GH"});
289 AssertAllFiles(fs, {"AB/abc", "AB/def"});
290}
291
292void GenericFileSystemTest::TestDeleteDirContents(FileSystem* fs) {
293 if (have_flaky_directory_tree_deletion()) GTEST_SKIP() << "Flaky directory deletion";

Callers

nothing calls this directly

Calls 6

CreateFileFunction · 0.85
AssertAllDirsFunction · 0.85
AssertAllFilesFunction · 0.85
CreateDirMethod · 0.45
DeleteDirMethod · 0.45

Tested by

no test coverage detected