Add a check of the current behaviour importing duplicates
[cabal.git] / cabal-testsuite / PackageTests / HaddockKeepTmpsCustom / cabal.test.hs
blobe2d819e44d6f745d412fe07a01b14991355d7536
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
6 cabal "haddock" []
8 -- From the docs for `System.IO.openTempFile`:
9 --
10 -- On Windows, the template prefix may be truncated to 3 chars, e.g.
11 -- "foobar.ext" will be "fooXXX.ext".
12 let glob =
13 if isWindows
14 then "had*.txt"
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
21 -- response file.
22 assertAnyFileContains responseFiles "--package-name"