File: test.hs

package info (click to toggle)
haskell-hashed-storage 0.5.10-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 328 kB
  • ctags: 73
  • sloc: haskell: 2,162; ansic: 799; makefile: 3
file content (17 lines) | stat: -rw-r--r-- 743 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE ScopedTypeVariables #-}
import Storage.Hashed.Test( tests )
import Prelude hiding( catch )
import Test.Framework( defaultMain )
import System.Directory( createDirectory, removeDirectoryRecursive
                       , setCurrentDirectory )
import Codec.Archive.Zip( extractFilesFromArchive, toArchive )
import qualified Data.ByteString.Lazy as BL
import Control.Exception( catch, IOException )

main :: IO ()
main = do zip <- toArchive `fmap` BL.readFile "testdata.zip"
          removeDirectoryRecursive "_test_playground" `catch` \(_ :: IOException) -> return ()
          createDirectory "_test_playground"
          setCurrentDirectory "_test_playground"
          extractFilesFromArchive [] zip
          defaultMain tests