{-# LANGUAGE RankNTypes #-}
module Test.Tasty.Golden.Advanced
(
goldenTest,
goldenTest2
)
where
import Test.Tasty.Providers
import Test.Tasty.Golden.Internal
goldenTest
:: TestName
-> (IO a)
-> (IO a)
-> (a -> a -> IO (Maybe String))
-> (a -> IO ())
-> TestTree
goldenTest :: TestName
-> IO a
-> IO a
-> (a -> a -> IO (Maybe TestName))
-> (a -> IO ())
-> TestTree
goldenTest TestName
t IO a
golden IO a
test a -> a -> IO (Maybe TestName)
cmp a -> IO ()
upd = TestName -> Golden -> TestTree
forall t. IsTest t => TestName -> t -> TestTree
singleTest TestName
t (Golden -> TestTree) -> Golden -> TestTree
forall a b. (a -> b) -> a -> b
$ IO a
-> IO a
-> (a -> a -> IO (Maybe TestName))
-> (a -> IO ())
-> IO ()
-> Golden
forall a.
IO a
-> IO a
-> (a -> a -> IO (Maybe TestName))
-> (a -> IO ())
-> IO ()
-> Golden
Golden IO a
golden IO a
test a -> a -> IO (Maybe TestName)
cmp a -> IO ()
upd (() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ())
goldenTest2
:: TestName
-> IO a
-> IO a
-> (a -> a -> IO (Maybe String))
-> (a -> IO ())
-> IO ()
-> TestTree
goldenTest2 :: TestName
-> IO a
-> IO a
-> (a -> a -> IO (Maybe TestName))
-> (a -> IO ())
-> IO ()
-> TestTree
goldenTest2 TestName
t IO a
golden IO a
test a -> a -> IO (Maybe TestName)
cmp a -> IO ()
upd IO ()
del = TestName -> Golden -> TestTree
forall t. IsTest t => TestName -> t -> TestTree
singleTest TestName
t (Golden -> TestTree) -> Golden -> TestTree
forall a b. (a -> b) -> a -> b
$ IO a
-> IO a
-> (a -> a -> IO (Maybe TestName))
-> (a -> IO ())
-> IO ()
-> Golden
forall a.
IO a
-> IO a
-> (a -> a -> IO (Maybe TestName))
-> (a -> IO ())
-> IO ()
-> Golden
Golden IO a
golden IO a
test a -> a -> IO (Maybe TestName)
cmp a -> IO ()
upd IO ()
del