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

[ library, mit, testing ] [ Propose Tags ]

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]
Versions [RSS] [faq] 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
Change log CHANGELOG.md
Dependencies ansi-terminal (>=0.6.2.1), async, base (>=4.5), bytestring (>=0.9.2.1), 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) [details]
License MIT
Author Philipp Hausmann, Roman Cheplyaka and others
Maintainer Philipp Hausmann, Andreas Abel
Category Testing
Home page https://github.com/phile314/tasty-silver
Bug tracker https://github.com/phile314/tasty-silver/issues
Source repo head: git clone git://github.com/phile314/tasty-silver.git
Uploaded by AndreasAbel at 2021-10-13T21:49:08Z
Distributions Arch:3.2.1, LTSHaskell:3.2.3, NixOS:3.2.2, Stackage:3.3.1
Downloads 19757 total (656 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Candidates


Readme for tasty-silver-3.3.1

[back to package description]

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

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.