HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulehedgehog-extras-0.10.1.0Haskell2010

Hedgehog.Extras.Test.Golden

  • 3 values
valuediffVsGoldenFile
  1. :: (HasCallStack, MonadIO m, MonadBaseControl IO m, MonadTest m)
  2. => String

    Actual content

  3. -> FilePath

    Reference file

  4. -> 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.

valuediffFileVsGoldenFile
  1. :: (HasCallStack, MonadBaseControl IO m, MonadIO m, MonadTest m)
  2. => FilePath

    Actual file

  3. -> FilePath

    Reference file

  4. -> 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.

Diff contents against the golden file, excluding the trace. 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.