tasty-golden-2.0: Golden tests support for tasty

Safe HaskellNone

Test.Tasty.Golden

Description

This module provides a simplified interface. If you want more, see Test.Tasty.Golden.Advanced.

Synopsis

Documentation

goldenVsFileSource

Arguments

:: TestName

test name

-> FilePath

path to the «golden» file (the file that contains correct output)

-> FilePath

path to the output file

-> IO ()

action that creates the output file

-> TestTree

the test verifies that the output file contents is the same as the golden file contents

Compare a given file contents against the golden file contents

goldenVsStringSource

Arguments

:: TestName

test name

-> FilePath

path to the «golden» file (the file that contains correct output)

-> IO ByteString

action that returns a string

-> TestTree

the test verifies that the returned string is the same as the golden file contents

Compare a given string against the golden file contents

goldenVsFileDiffSource

Arguments

:: TestName

test name

-> (FilePath -> FilePath -> [String])

function that constructs the command line to invoke the diff command.

E.g.

\ref new -> ["diff", "-u", ref, new]
-> FilePath

path to the golden file

-> FilePath

path to the output file

-> IO ()

action that produces the output file

-> TestTree 

Same as goldenVsFile, but invokes an external diff command.