tasty-silver-3.3: A fancy test runner, including support for golden tests.
Safe HaskellNone
LanguageHaskell2010

Test.Tasty.Silver.Internal

Synopsis

Documentation

data Golden Source #

See goldenTest1 for explanation of the fields.

Constructors

forall a. Golden (IO (Maybe a)) (IO a) (a -> a -> IO GDiff) (a -> IO GShow) (Maybe (a -> IO ())) 

Instances

Instances details
IsTest Golden Source # 
Instance details

Defined in Test.Tasty.Silver.Internal

readFileMaybe :: FilePath -> IO (Maybe ByteString) Source #

Read the file if it exists, else return Nothing. Useful for reading golden files.

data GDiff Source #

The comparison/diff result.

Constructors

Equal

Values are equal.

DiffText

The two values are different, show a diff between the two given texts.

ShowDiffed

The two values are different, just show the given text to the user.

Fields

data GShow Source #

How to show a value to the user.

Constructors

ShowText Text

Show the given text.

data GoldenResult' m Source #

Constructors

GREqual 
forall a. GRDifferent a a GDiff (Maybe (a -> IO ())) 
forall a. GRNoGolden (m a) (a -> IO GShow) (Maybe (a -> IO ())) 

Instances

Instances details
Show (GoldenResult' m) Source # 
Instance details

Defined in Test.Tasty.Silver.Internal

Generic utilites

ifM :: Monad m => m Bool -> m a -> m a -> m a Source #

Monadic if.

ifNotM :: Monad m => m Bool -> m a -> m a -> m a Source #

Monadic if (not ...) ....

and2M :: Monad m => m Bool -> m Bool -> m Bool Source #

Short-cutting version of liftM2 (&&).

andM :: Monad m => [m Bool] -> m Bool Source #

Short-cutting version of and . sequence.

or2M :: Monad m => m Bool -> m Bool -> m Bool Source #

Short-cutting version of liftM2 (||).

orM :: Monad m => [m Bool] -> m Bool Source #

Short-cutting version of or . sequence.