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.


Keywords
mit, testing, Propose Tags, Skip to Readme, , Index, Quick Jump, Test.Tasty.Silver, Test.Tasty.Silver.Advanced, Test.Tasty.Silver.Filter, Test.Tasty.Silver.Interactive, Test.Tasty.Silver.Interactive.Run, Test.Tasty.Silver.Internal, tasty-silver-3.3.1.3.tar.gz, browse, Package description, Package maintainers, AndreasAbel, PhilippHausmann, edit package information , 3.1.11, 3.2.3, 3.3, 3.3.1, 3.3.1.1, 3.3.1.2, 3.3.1.3, GitHub CI virtual environments, Agda tests, Philipp Hausmann, Andreas Abel
License
MIT
Install
cabal install tasty-silver-3.1.9

Documentation

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.