/usr/share/doc/libghc-tasty-golden-doc/html/tasty-golden.txt is in libghc-tasty-golden-doc 2.3.1-1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Golden tests support for tasty
--
-- 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.
@package tasty-golden
@version 2.3.1
-- | Previously, accepting tests (by the <tt>--accept</tt> flag) was done
-- by this module, and there was an ingredient to handle that mode.
--
-- Now it's done as part of a normal test run. When the `--accept` flag
-- is given, it makes golden tests to update the files whenever there is
-- a mismatch. So you no longer need this module. It remains only for
-- backwards compatibility.
module Test.Tasty.Golden.Manage
-- | This exists only for backwards compatibility. Use <a>defaultMain</a>
-- instead.
defaultMain :: TestTree -> IO ()
-- | This exists only for backwards compatibility. You don't need to
-- include this anymore.
acceptingTests :: Ingredient
-- | This option, when set to <a>True</a>, specifies that we should run in
-- the «accept tests» mode
newtype AcceptTests
AcceptTests :: Bool -> AcceptTests
module Test.Tasty.Golden.Advanced
-- | A very general testing function.
goldenTest :: TestName -> (IO a) -> (IO a) -> (a -> a -> IO (Maybe String)) -> (a -> IO ()) -> TestTree
-- | This module provides a simplified interface. If you want more, see
-- <a>Test.Tasty.Golden.Advanced</a>.
--
-- Note about filenames. They are looked up in the usual way, thus
-- relative names are relative to the processes current working
-- directory. It is common to run tests from the package's root directory
-- (via <tt>cabal test</tt> or <tt>cabal install --enable-tests</tt>), so
-- if your test files are under the <tt>tests/</tt> subdirectory, your
-- relative file names should start with <tt>tests/</tt> (even if your
-- <tt>test.hs</tt> is itself under <tt>tests/</tt>, too).
--
-- Note about line endings. The best way to avoid headaches with line
-- endings (when running tests both on UNIX and Windows) is to treat your
-- golden files as binary, even when they are actually textual.
--
-- This means:
--
-- <ul>
-- <li>When writing output files from Haskell code, open them in binary
-- mode (see <a>openBinaryFile</a>, <a>withBinaryFile</a> and
-- <a>hSetBinaryMode</a>). This will disable automatic <tt>\n ->
-- \r\n</tt> conversion on Windows. For convenience, this module exports
-- <a>writeBinaryFile</a> which is just like <a>writeFile</a> but opens
-- the file in binary mode. When using <tt>ByteString</tt>s note that
-- <a>Data.ByteString</a> and <a>Data.ByteString.Lazy</a> use binary mode
-- for <tt>writeFile</tt>, while <a>Data.ByteString.Char8</a> and
-- <a>Data.ByteString.Lazy.Char8</a> use text mode.</li>
-- <li>Tell your VCS not to do any newline conversion for golden files.
-- For git check in a <tt>.gitattributes</tt> file with the following
-- contents (assuming your golden files have <tt>.golden</tt>
-- extension):</li>
-- </ul>
--
-- <pre>
-- *.golden -text
-- </pre>
--
-- On its side, tasty-golden reads and writes files in binary mode, too.
--
-- Why not let Haskell/git do automatic conversion on Windows? Well, for
-- instance, <tt>tar</tt> will not do the conversion for you when
-- unpacking a release tarball, so when you run <tt>cabal install
-- your-package --enable-tests</tt>, the tests will be broken.
--
-- As a last resort, you can strip all <tt>\r</tt>s from both arguments
-- in your comparison function when necessary. But most of the time
-- treating the files as binary does the job.
module Test.Tasty.Golden
-- | Compare a given file contents against the golden file contents
goldenVsFile :: TestName -> FilePath -> FilePath -> IO () -> TestTree
-- | Compare a given string against the golden file contents
goldenVsString :: TestName -> FilePath -> IO ByteString -> TestTree
-- | Same as <a>goldenVsFile</a>, but invokes an external diff command.
goldenVsFileDiff :: TestName -> (FilePath -> FilePath -> [String]) -> FilePath -> FilePath -> IO () -> TestTree
-- | Same as <a>goldenVsString</a>, but invokes an external diff command.
goldenVsStringDiff :: TestName -> (FilePath -> FilePath -> [String]) -> FilePath -> IO ByteString -> TestTree
-- | Like <a>writeFile</a>, but uses binary mode
writeBinaryFile :: FilePath -> String -> IO ()
-- | Find all files in the given directory and its subdirectories that have
-- the given extensions.
--
-- It is typically used to find all test files and produce a golden test
-- per test file.
--
-- The returned paths use forward slashes to separate path components,
-- even on Windows. Thus if the file name ends up in a golden file, it
-- will not differ when run on another platform.
--
-- The semantics of extensions is the same as in <a>takeExtension</a>. In
-- particular, non-empty extensions should have the form <tt>".ext"</tt>.
--
-- This function may throw any exception that <a>getDirectoryContents</a>
-- may throw.
--
-- It doesn't do anything special to handle symlinks (in particular, it
-- probably won't work on symlink loops).
--
-- Nor is it optimized to work with huge directory trees (you'd probably
-- want to use some form of coroutines for that).
findByExtension :: [FilePath] -> FilePath -> IO [FilePath]
|