From f3f5c0ad6df710d7aaa8e4b36af98f9fdb4bb590 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Sat, 20 Jan 2024 14:58:38 -0500 Subject: [PATCH] Satisfy -Wincomplete-uni-patterns with toTarPath --- hackage-security/tests/TestSuite.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hackage-security/tests/TestSuite.hs b/hackage-security/tests/TestSuite.hs index 598e1519..f5c038ae 100644 --- a/hackage-security/tests/TestSuite.hs +++ b/hackage-security/tests/TestSuite.hs @@ -238,7 +238,7 @@ testRepoIndex inMemRepo repo = do length (directoryEntries dir1) @?= 0 now <- getCurrentTime - inMemRepoSetIndex inMemRepo now [testEntry1] + inMemRepoSetIndex inMemRepo now testEntries1 assertEqual "B" HasUpdates =<< checkForUpdates repo =<< checkExpiry dir2 <- getDirectory repo @@ -264,9 +264,9 @@ testRepoIndex inMemRepo repo = do _ -> fail "unexpected index entry content" _ -> fail "unexpected index path" - testEntry1 = Tar.fileEntry path testEntrycontent - where - Right path = Tar.toTarPath False "foo/preferred-versions" + testEntries1 :: [Tar.GenEntry Tar.TarPath linkTarget] + testEntries1 = either (const []) (pure . (`Tar.fileEntry` testEntrycontent)) + (Tar.toTarPath False "foo/preferred-versions") testEntrycontent = BS.pack "foo >= 1" testEntryIndexFile = IndexPkgPrefs (mkPackageName "foo")