hedgehog-extras-0.6.1.0: Supplemental library for hedgehog
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hedgehog.Extras.Test.Golden

Synopsis

Documentation

diffVsGoldenFile Source #

Arguments

:: HasCallStack 
=> (MonadIO m, MonadTest m) 
=> String

Actual content

-> FilePath

Reference file

-> m () 

Diff contents against the golden file. If CREATE_GOLDEN_FILES environment is set to "1", then should the golden file not exist it would be created. If RECREATE_GOLDEN_FILES is set to "1", then should the golden file exist it would be recreated. If GOLDEN_FILE_LOG_FILE is set to a filename, then the golden file path will be logged to the specified file.

Set the environment variable when you intend to generate or re-generate the golden file for example when running the test for the first time or if the golden file genuinely needs to change.

To re-generate a golden file you must also delete the golden file because golden files are never overwritten.

TODO: Improve the help output by saying the difference of each input.

diffFileVsGoldenFile Source #

Arguments

:: HasCallStack 
=> (MonadIO m, MonadTest m) 
=> FilePath

Actual file

-> FilePath

Reference file

-> m () 

Diff file against the golden file. If CREATE_GOLDEN_FILES environment is set to "1", then should the gold file not exist it would be created. If GOLDEN_FILE_LOG_FILE is set to a filename, then the golden file path will be logged to the specified file.

Set the environment variable when you intend to generate or re-generate the golden file for example when running the test for the first time or if the golden file genuinely needs to change.

To re-generate a golden file you must also delete the golden file because golden files are never overwritten.