Create previously deleted symlink dynamically

This change has not been tested yet.
This commit is contained in:
Martchus 2023-06-11 00:11:02 +02:00
parent 22563561dc
commit e72f4afbca
2 changed files with 4 additions and 0 deletions

3
.gitignore vendored
View File

@ -43,6 +43,9 @@ Makefile*
# clang-format
.clang-format
# dynamically created testfiles
libpkg/testfiles/repo/foo/missing-0-any.pkg.tar.zst
# node modules (only essential JavaScript and CSS files are force-added)
/srv/static/package-lock.json
/srv/static/node_modules/

View File

@ -445,6 +445,7 @@ void DataTests::testLocatePackage()
setupPackages();
auto &db = m_config.databases.front();
db.localPkgDir = std::filesystem::path(fakePkgPath).parent_path();
std::filesystem::create_symlink("does_not_exist", db.localPkgDir + "/missing-0-any.pkg.tar.zst");
const auto emptyPkg = db.locatePackage(std::string());
CPPUNIT_ASSERT_EQUAL(std::string(), emptyPkg.pathWithinRepo.string());