Safe Haskell | None |
---|
This module provides a simplified interface. If you want more, see Test.Golden.Advanced.
- goldenVsFile :: TestName -> FilePath -> FilePath -> IO () -> Test
- goldenVsString :: TestName -> FilePath -> IO ByteString -> Test
- goldenVsFileDiff :: TestName -> (FilePath -> FilePath -> [String]) -> FilePath -> FilePath -> IO () -> Test
- goldenVsStringDiff :: TestName -> (FilePath -> FilePath -> [String]) -> FilePath -> IO ByteString -> Test
Documentation
:: 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 |
-> Test | 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
:: TestName | test name |
-> FilePath | path to the «golden» file (the file that contains correct output) |
-> IO ByteString | action that returns a string |
-> Test | the test verifies that the returned string is the same as the golden file contents |
Compare a given string against the golden file contents
:: 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 |
-> Test |
Same as goldenVsFile
, but invokes an external diff command.
:: 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 |
-> IO ByteString | action that returns a string |
-> Test |
Same as goldenVsString
, but invokes an external diff command.