Make std::experimental::filesystem::remove and remove_all return false or 0 if the file doesn't exist
Differential Revision: https://reviews.llvm.org/D41830 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@322293 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -61,17 +61,29 @@ TEST_CASE(test_error_reporting)
|
||||
const path file_in_bad_dir = env.create_file(bad_perms_dir / "file", 42);
|
||||
permissions(bad_perms_dir, perms::none);
|
||||
const path testCases[] = {
|
||||
"",
|
||||
env.make_env_path("dne"),
|
||||
non_empty_dir,
|
||||
file_in_bad_dir,
|
||||
};
|
||||
for (auto& p : testCases) {
|
||||
std::error_code ec;
|
||||
|
||||
TEST_CHECK(!fs::remove(p, ec));
|
||||
TEST_CHECK(ec);
|
||||
TEST_CHECK(checkThrow(p, ec));
|
||||
}
|
||||
|
||||
// PR#35780
|
||||
const path testCasesNonexistant[] = {
|
||||
"",
|
||||
env.make_env_path("dne")
|
||||
};
|
||||
|
||||
for (auto& p : testCasesNonexistant) {
|
||||
std::error_code ec;
|
||||
|
||||
TEST_CHECK(!fs::remove(p, ec));
|
||||
TEST_CHECK(!ec);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE(basic_remove_test)
|
||||
|
||||
Reference in New Issue
Block a user