From cf27699c00909854ac63ed392acbc1ff6ce3292c Mon Sep 17 00:00:00 2001 From: Riyyi Date: Tue, 1 Mar 2022 22:38:46 +0100 Subject: [PATCH] Test: Also delete symbolic links that point to non-existent files --- test/unit/testdotfile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/testdotfile.cpp b/test/unit/testdotfile.cpp index ce42833..fb8ebd4 100644 --- a/test/unit/testdotfile.cpp +++ b/test/unit/testdotfile.cpp @@ -64,13 +64,13 @@ void removeTestDotfiles(const std::vector& files) file = file.substr(0, file.find_first_of('/')); // 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); } // Delete recursively in home directory file = homeDirectory / file; - if (std::filesystem::exists(file)) { + if (std::filesystem::exists(file) || std::filesystem::is_symlink(file)) { std::filesystem::remove_all(file); } }