-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Golden tests support for tasty
--   
--   This package provides support for «golden testing»A golden test is an
--   IO action that writes its result to a file. To pass the test, this
--   output file should be identical to the corresponding «golden» file,
--   which contains the correct result for the test
@package tasty-golden
@version 2.2.0.2


-- | Golden test management
module Test.Tasty.Golden.Manage

-- | Like <tt>defaultMain</tt> from the main tasty package, but also
--   includes the golden test management capabilities.
defaultMain :: TestTree -> IO ()
acceptingTests :: Ingredient

-- | This option, when set to <a>True</a>, specifies that we should run in
--   the «accept tests» mod
newtype AcceptTests
AcceptTests :: Bool -> AcceptTests

-- | Accept all golden tests in the test tree
acceptGoldenTests :: OptionSet -> TestTree -> IO ()
instance Typeable AcceptTests
instance Eq AcceptTests
instance Ord AcceptTests
instance IsOption AcceptTests

module Test.Tasty.Golden.Advanced

-- | A very general testing function.
goldenTest :: TestName -> (forall r. ValueGetter r a) -> (forall r. ValueGetter r a) -> (a -> a -> IO (Maybe String)) -> (a -> IO ()) -> TestTree

-- | An action that yields a value (either golden or tested).
--   
--   CPS allows closing the file handle when using lazy IO to read data.
newtype ValueGetter r a
ValueGetter :: ContT r IO a -> ValueGetter r a
runValueGetter :: ValueGetter r a -> ContT r IO a

-- | Lazily read a file. The file handle will be closed after the
--   <a>ValueGetter</a> action is run.
vgReadFile :: FilePath -> ValueGetter r ByteString


-- | This module provides a simplified interface. If you want more, see
--   <a>Test.Tasty.Golden.Advanced</a>.
module Test.Tasty.Golden

-- | Compare a given file contents against the golden file contents
goldenVsFile :: TestName -> FilePath -> FilePath -> IO () -> TestTree

-- | Compare a given string against the golden file contents
goldenVsString :: TestName -> FilePath -> IO ByteString -> TestTree

-- | Same as <a>goldenVsFile</a>, but invokes an external diff command.
goldenVsFileDiff :: TestName -> (FilePath -> FilePath -> [String]) -> FilePath -> FilePath -> IO () -> TestTree

-- | Same as <a>goldenVsString</a>, but invokes an external diff command.
goldenVsStringDiff :: TestName -> (FilePath -> FilePath -> [String]) -> FilePath -> IO ByteString -> TestTree
