hw-polysemy-0.2.4.0: Opinionated polysemy library
Safe HaskellSafe-Inferred
LanguageGHC2021

HaskellWorks.Polysemy.Hedgehog.Golden

Synopsis

Documentation

diffVsGoldenFile Source #

Arguments

:: HasCallStack 
=> Member Hedgehog r 
=> Member (Embed IO) r 
=> Member Resource r 
=> Member Log r 
=> String

Actual content

-> FilePath

Reference file

-> Sem r () 

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 
=> Member (Embed IO) r 
=> Member Hedgehog r 
=> Member Log r 
=> Member Resource r 
=> FilePath

Actual file

-> FilePath

Reference file

-> Sem r () 

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.