tasty-golden: Golden tests support for tasty

[ library, mit, testing ] [ Propose Tags ] [ Report a vulnerability ]

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. To get started with golden testing and this library, see Introduction to golden testing.


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
build-exampleDisabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 2.0, 2.0.1, 2.1, 2.2, 2.2.0.1, 2.2.0.2, 2.2.1, 2.2.1.1, 2.2.1.2, 2.2.2, 2.2.2.1, 2.2.2.2, 2.2.2.3, 2.2.2.4, 2.3, 2.3.0.1, 2.3.0.2, 2.3.1, 2.3.1.1, 2.3.1.2, 2.3.1.3, 2.3.2, 2.3.2.1, 2.3.3, 2.3.3.1, 2.3.3.2, 2.3.3.3, 2.3.4, 2.3.5, 2.3.6
Change log CHANGELOG.md
Dependencies base (>=4.9 && <5), bytestring (>=0.9.2.1), containers, deepseq, directory, filepath, optparse-applicative (>=0.3.1), tasty (>=1.3), tasty-golden, temporary, text, typed-process [details]
Tested with ghc ==9.14.1, ghc ==9.12.2, ghc ==9.10.3, ghc ==9.8.4, ghc ==9.6.7, ghc ==9.4.8, ghc ==9.2.8, ghc ==9.0.2, ghc ==8.10.7, ghc ==8.8.4, ghc ==8.6.5, ghc ==8.4.4, ghc ==8.2.2, ghc ==8.0.2
License MIT
Author Roman Cheplyaka
Maintainer Roman Cheplyaka <roma@ro-che.info>
Uploaded by AndreasAbel at 2026-02-01T10:41:00Z
Category Testing
Home page https://github.com/UnkindPartition/tasty-golden
Bug tracker https://github.com/UnkindPartition/tasty-golden/issues
Source repo head: git clone https://github.com/UnkindPartition/tasty-golden.git
Distributions Arch:2.3.5, Debian:2.3.3.2, LTSHaskell:2.3.5, NixOS:2.3.5, Stackage:2.3.5
Reverse Dependencies 8 direct, 10 indirect [details]
Executables example
Downloads 54100 total (130 in the last 30 days)
Rating 1.75 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-02-01 [all 1 reports]

Readme for tasty-golden-2.3.6

[back to package description]

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.

To get started with golden testing and this library, see Introduction to golden testing.

Command-line options

To see the command-line options, run your test suite with --help. Here's an example output:

Mmm... tasty test suite

Usage: test [-p|--pattern PATTERN] [-t|--timeout DURATION] [-l|--list-tests]
            [-j|--num-threads NUMBER] [-q|--quiet] [--hide-successes]
            [--color never|always|auto] [--ansi-tricks ARG] [--accept]
            [--no-create] [--size-cutoff n]
            [--delete-output never|onpass|always]

Available options:
  -h,--help                Show this help text
  -p,--pattern PATTERN     Select only tests which satisfy a pattern or awk
                           expression
  -t,--timeout DURATION    Timeout for individual tests (suffixes: ms,s,m,h;
                           default: s)
  -l,--list-tests          Do not run the tests; just print their names
  -j,--num-threads NUMBER  Number of threads to use for tests
                           execution (default: # of cores/capabilities)
  -q,--quiet               Do not produce any output; indicate success only by
                           the exit code
  --hide-successes         Do not print tests that passed successfully
  --color never|always|auto
                           When to use colored output (default: auto)
  --ansi-tricks ARG        Enable various ANSI terminal tricks. Can be set to
                           'true' or 'false'. (default: true)
  --accept                 Accept current results of golden tests
  --no-create              Error when golden file does not exist
  --size-cutoff n          hide golden test output if it's larger than n
                           bytes (default: 1000)
  --delete-output never|onpass|always
                           If there is a golden file, when to delete output
                           files (default: never)

See also tasty's README.

Maintainers

Roman Cheplyaka is the primary maintainer.

Oliver Charles is the backup maintainer. Please get in touch with him if the primary maintainer cannot be reached.