1 import Test
.Cabal
.Prelude
3 -- Test that "cabal haddock" preserves temporary files
4 -- We use haddock-keep-temp-file: True in the cabal.project.
5 main
= cabalTest
$ recordMode DoNotRecord
$ withProjectFile
"cabal.project" $ do
8 -- From the docs for `System.IO.openTempFile`:
10 -- On Windows, the template prefix may be truncated to 3 chars, e.g.
11 -- "foobar.ext" will be "fooXXX.ext".
15 else "haddock-response*.txt"
17 -- Check that there is a response file.
18 responseFiles
<- assertGlobMatchesTestDir testTmpDir glob
20 -- Check that the matched response file is not empty, and is indeed a Haddock
22 assertAnyFileContains responseFiles
"--package-name"