packages feed

hspec-dirstream-0.5.0.0: test/Spec.hs

{-# LANGUAGE OverloadedStrings #-}

import           Control.Monad
import qualified Data.ByteString.Lazy as BSL
import           Test.Hspec
import           Test.Hspec.Dirstream

main :: IO ()
main = hspec $ parallel $ do
    describe "testFiles" $
            testFiles "test/data" (hasExtension "hs") ((pure :: a -> Either String a) . tail)
    describe "testFilesIO" $
            testFilesIO "test/data" (hasExtension "hs") (pure . tail)
    describe "testFilesPredicate" $
            testFilesPredicate "test/data" (hasExtension "hs") tail ((>= 0) . length)
    describe "testFilesPredicateBS" $
            testFilesPredicateBS "test/data" (hasExtension "hs") id ((>= 0) . BSL.length)
    describe "testPaths" $
            testPaths "test/data" (hasExtension "hs") (void . readFile)