{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK prune not-home #-}
module Test.KeyedVals.Hspec (
checkHandle,
setupFixture,
closeFixture,
module Test.KeyedVals.Prelude,
) where
import qualified Test.KeyedVals.CheckHandle as LessTyped
import qualified Test.KeyedVals.CheckTypedHandle as Typed
import Test.KeyedVals.Prelude
checkHandle :: SpecWith (Handle IO)
checkHandle :: SpecWith (Handle IO)
checkHandle = do
SpecWith (Handle IO)
LessTyped.spec
SpecWith (Handle IO)
Typed.spec
setupFixture :: Handle IO -> IO (Handle IO)
setupFixture :: Handle IO -> IO (Handle IO)
setupFixture Handle IO
h = do
IO (Handle IO) -> IO ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (IO (Handle IO) -> IO ()) -> IO (Handle IO) -> IO ()
forall a b. (a -> b) -> a -> b
$ Handle IO -> IO (Handle IO)
LessTyped.setupFixture Handle IO
h
IO (Handle IO) -> IO ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (IO (Handle IO) -> IO ()) -> IO (Handle IO) -> IO ()
forall a b. (a -> b) -> a -> b
$ Handle IO -> IO (Handle IO)
Typed.setupFixture Handle IO
h
Handle IO -> IO (Handle IO)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Handle IO
h
closeFixture :: Handle IO -> IO ()
closeFixture :: Handle IO -> IO ()
closeFixture = Handle IO -> IO ()
forall (m :: * -> *). Handle m -> m ()
close