tasty-silver: A fancy test runner, including support for golden tests.

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

This package provides a fancy test runner and 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.

The test runner allows filtering tests using regexes, and to interactively inspect the result of golden tests.

This package is a heavily extended fork of tasty-golden.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 3.0, 3.0.0.1, 3.0.1.0, 3.0.2.0, 3.0.2.1, 3.0.2.2, 3.1, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.8.1, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.14, 3.1.15, 3.2, 3.2.1, 3.2.2, 3.2.3, 3.3, 3.3.1, 3.3.1.1, 3.3.1.2, 3.3.1.3, 3.3.2 (info)
Change log CHANGELOG.md
Dependencies ansi-terminal (>=0.6.2.1), async, base (>=4.6 && <5), bytestring (>=0.10.0.0), containers, deepseq, directory (>=1.2.3.0), filepath, mtl, optparse-applicative, process (>=1.2), process-extras (>=0.3), regex-tdfa (>=1.2.0), semigroups (>=0.18.3), silently (>=1.2.5.1), stm (>=2.4.2), tagged, tasty (>=1.4), temporary, text (>=0.11.0.0), transformers (>=0.3) [details]
Tested with ghc ==9.10.1, ghc ==9.8.2, ghc ==9.6.6, 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 Philipp Hausmann, Andreas Abel, Roman Cheplyaka, and others
Maintainer Andreas Abel, Philipp Hausmann
Category Testing
Home page https://github.com/phile314/tasty-silver
Bug tracker https://github.com/phile314/tasty-silver/issues
Source repo head: git clone https://github.com/phile314/tasty-silver.git
Uploaded by AndreasAbel at 2024-07-19T15:14:59Z
Distributions Arch:3.3.2, LTSHaskell:3.3.2, NixOS:3.3.2, Stackage:3.3.2
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 26516 total (85 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-07-19 [all 1 reports]

Readme for tasty-silver-3.3.2

[back to package description]

Hackage version tasty-silver on Stackage Nightly Stackage LTS version Haskell-CI macOS windows

Tasty Silver

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.

Interactive Mode

If the test runner is called with the -i option, the diff of any failing golden test is shown to the user. Based upon this diff, the user can choose to update the golden standard or to fix the test case as necessary. Interactive mode requires that at least git diff and less is available, or preferrably wdiff and colordiff for character-based diffs.

Portability

tasty-silver aims to work under Linux, macOS, and Windows. In particular, it should work in the GitHub CI virtual environments.

Known limitations:

  • On macOS, GHC ≥ 7.10 is required, as GHC ≤ 7.8 produces code that is not compatible with the System Integrity Protection mechanism of Mac OS X. In particular, you could see errors like:

    /usr/bin/less: getPermissions:fileAccess: permission denied (Operation not permitted)
    
  • On Windows, the colored diff may not be available as it depends on the availability of colordiff, less, sh, and wdiff.

Examples

For a non-trivial example see the Agda tests, which is used for testing the Agda compiler.

Maintainers

Philipp Hausmann is the primary maintainer. Andreas Abel is co-maintainer.