Golden tests support for tasty


Version on this page:
LTS Haskell 22.22:2.3.5
Stackage Nightly 2024-05-21:2.3.5
Latest on Hackage:2.3.5

See all snapshots tasty-golden appears in

MIT licensed by Roman Cheplyaka
Maintained by Roman Cheplyaka
This version can be pinned in stack with:tasty-golden-,1728

Module documentation for

This package provides support for «golden testing». A golden test is an IO action that writes its result to a file. To pass the test, this output file should be identical to the corresponding «golden» file, which contains the correct result for the test.




Impose a lower bound version constraint on bytestring.

Version 2.3

  • Accepting tests is no longer done by a separate ingredient; instead it is now an option that affects tests themselves.

    • --accept used to run only golden tests; now all tests are run, but only golden tests are affected by this option
    • when accepting, all the usual options apply (such as -j)
    • when accepting, the interace is the same as when running
    • defaultMain and acceptingTests are kept for compatibility, but do not do anything and are obsolete
  • When a golden test file does not exist, it is created automatically, even when --accept is not specified. You’ll see a message like

      UnboxedTuples:                 OK (0.04s)
        Golden file did not exist; created
  • No longer use lazy IO

    • ValueGetter type is gone (replaced by IO)
    • Because of that, the type of the primitive goldenTest is changed
    • vgReadFile function is gone (replaced by Data.ByteString.readFile)


  • Warn when some tests threw exceptions during --accept
  • Properly handle exceptions; don’t swallow Ctrl-C


Restore compatibility with older compilers


Relax Cabal dependency

Version 2.2.2

Add findByExtension


Catch exceptions when accepting golden tests


Switch to temporary-rc

Version 2.2.1

  • Fix a bug where the result of the comparison function would reference yet unread data from a semiclosed file and the file gets closed, leading to a runtime exception
  • Export writeBinaryFile
  • Improve the docs
  • Update to work with tasty-0.8


Update to work with tasty-0.7


Update to work with tasty-0.5

Version 2.2

Migrate to ingredients

Version 2.1

Add goldenVsStringDiff

Version 2.0.1

Update to work with tasty-0.2

Version 2.0

Initial release of tasty-golden (derived from test-framework-golden-1.1.x)