{-# LANGUAGE CPP #-}
module GetDataFileName (
withTestFileProperty,
(<:<),
)
where
import Control.Monad.IO.Class
import Hedgehog.Internal.Property
import Prelude
#ifdef CARDANO_LEDGER_BYRON_TEST
import Paths_cardano_ledger_byron_test (getDataFileName)
#else
import Paths_cardano_ledger_byron (getDataFileName)
#endif
withTestFileProperty :: FilePath -> (FilePath -> Property) -> Property
withTestFileProperty :: FilePath -> (FilePath -> Property) -> Property
withTestFileProperty FilePath
fp FilePath -> Property
mkProperty = PropertyConfig -> PropertyT IO () -> Property
Property PropertyConfig
config forall a b. (a -> b) -> a -> b
$ do
FilePath
actualFilePath <- forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ FilePath -> IO FilePath
getDataFileName FilePath
fp
Property -> PropertyT IO ()
propertyTest forall a b. (a -> b) -> a -> b
$ FilePath -> Property
mkProperty FilePath
actualFilePath
where
config :: PropertyConfig
config = Property -> PropertyConfig
propertyConfig forall a b. (a -> b) -> a -> b
$ FilePath -> Property
mkProperty FilePath
""
(<:<) :: (FilePath -> Property) -> FilePath -> Property
<:< :: (FilePath -> Property) -> FilePath -> Property
(<:<) = forall a b c. (a -> b -> c) -> b -> a -> c
flip FilePath -> (FilePath -> Property) -> Property
withTestFileProperty