Skip to content

Commit

Permalink
Benchmarks: explain where to obtain 01-index.tar
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim committed Nov 18, 2023
1 parent 423e6af commit 7d0517d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bench/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import qualified Codec.Archive.Tar.Index as TarIndex

import qualified Data.ByteString.Lazy as BS
import Control.Exception
import System.Directory

import Test.Tasty.Bench

Expand All @@ -26,8 +27,12 @@ benchmarks =
]

loadTarFile :: IO BS.ByteString
loadTarFile =
BS.readFile "01-index.tar"
loadTarFile = do
let tarFile = "01-index.tar"
exists <- doesFileExist tarFile
if exists
then BS.readFile tarFile
else error "01-index.tar does not exist, copy it from ~/.cabal/packages/hackage.haskell.org/01-index.tar"

loadTarEntries :: IO (Tar.Entries Tar.FormatError)
loadTarEntries =
Expand Down

0 comments on commit 7d0517d

Please sign in to comment.