Skip to content

Commit

Permalink
testsuite: Improve error message in findDependencyInStore
Browse files Browse the repository at this point in the history
  • Loading branch information
mpickering committed Nov 14, 2023
1 parent b5dc67b commit cc7f455
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cabal-testsuite/src/Test/Cabal/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1156,5 +1156,7 @@ findDependencyInStore storeDir pkgName = do
then filter (not . flip elem "aeiou") pkgName
-- simulates the way 'hashedInstalledPackageId' uses to compress package name
else pkgName
let libDir = head $ filter (pkgName' `isPrefixOf`) packageDirs
let libDir = case filter (pkgName' `isPrefixOf`) packageDirs of
[] -> error $ "Could not find " <> pkgName' <> " when searching for " <> pkgName' <> " in\n" <> show packageDirs
(dir:_) -> dir
pure (storeDir </> storeDirForGhcVersion </> libDir)

0 comments on commit cc7f455

Please sign in to comment.