From e72f4afbca8bea565df7ec9f21d469045740c7e6 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 11 Jun 2023 00:11:02 +0200 Subject: [PATCH] Create previously deleted symlink dynamically This change has not been tested yet. --- .gitignore | 3 +++ libpkg/tests/data.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index b6c10d4..15d6c6b 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/libpkg/tests/data.cpp b/libpkg/tests/data.cpp index ab6265a..6942b3f 100644 --- a/libpkg/tests/data.cpp +++ b/libpkg/tests/data.cpp @@ -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());