Browse Source

Test: Also delete symbolic links that point to non-existent files

master
Riyyi 3 years ago
parent
commit
cf27699c00
  1. 4
      test/unit/testdotfile.cpp

4
test/unit/testdotfile.cpp

@ -64,13 +64,13 @@ void removeTestDotfiles(const std::vector<std::string>& files)
file = file.substr(0, file.find_first_of('/')); file = file.substr(0, file.find_first_of('/'));
// Delete recursively in working directory // Delete recursively in working directory
if (std::filesystem::exists(file)) { if (std::filesystem::exists(file) || std::filesystem::is_symlink(file)) {
std::filesystem::remove_all(file); std::filesystem::remove_all(file);
} }
// Delete recursively in home directory // Delete recursively in home directory
file = homeDirectory / file; file = homeDirectory / file;
if (std::filesystem::exists(file)) { if (std::filesystem::exists(file) || std::filesystem::is_symlink(file)) {
std::filesystem::remove_all(file); std::filesystem::remove_all(file);
} }
} }

Loading…
Cancel
Save