diff options
Diffstat (limited to 'haddock-test')
-rw-r--r-- | haddock-test/haddock-test.cabal | 6 | ||||
-rw-r--r-- | haddock-test/src/Test/Haddock.hs | 8 | ||||
-rw-r--r-- | haddock-test/src/Test/Haddock/Xhtml.hs | 3 |
3 files changed, 9 insertions, 8 deletions
diff --git a/haddock-test/haddock-test.cabal b/haddock-test/haddock-test.cabal index df6c4474..4e3bfd29 100644 --- a/haddock-test/haddock-test.cabal +++ b/haddock-test/haddock-test.cabal @@ -1,8 +1,8 @@ -cabal-version: >= 1.10 +cabal-version: 3.0 name: haddock-test version: 0.0.1 synopsis: Test utilities for Haddock -license: BSD2 +license: BSD-2-Clause author: Simon Marlow, David Waern maintainer: Simon Hengel <sol@typeful.net>, Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> homepage: http://www.haskell.org/haddock/ @@ -10,7 +10,7 @@ bug-reports: https://github.com/haskell/haddock/issues copyright: (c) Simon Marlow, David Waern category: Documentation build-type: Simple -tested-with: GHC==9.0.* +tested-with: GHC==9.4.* stability: experimental library diff --git a/haddock-test/src/Test/Haddock.hs b/haddock-test/src/Test/Haddock.hs index 1019e815..fe547ad5 100644 --- a/haddock-test/src/Test/Haddock.hs +++ b/haddock-test/src/Test/Haddock.hs @@ -89,9 +89,9 @@ runHaddock cfg@(Config { .. }) = do , pure $ "--odir=" ++ outDir cfgDirConfig tpkg , tpkgFiles tpkg ] - , pcEnv = Just $ cfgEnv - , pcStdOut = Just $ haddockStdOut - , pcStdErr = Just $ haddockStdOut + , pcEnv = Just cfgEnv + , pcStdOut = Just haddockStdOut + , pcStdErr = Just haddockStdOut } let msg = "Failed to run Haddock on test package '" ++ tpkgName tpkg ++ "'" @@ -159,7 +159,7 @@ diffFile cfg diff file = do hFlush stdout handle <- runProcess' diff $ processConfig { pcArgs = [outFile', refFile'] - , pcStdOut = Just $ stdout + , pcStdOut = Just stdout } waitForProcess handle >> return () where diff --git a/haddock-test/src/Test/Haddock/Xhtml.hs b/haddock-test/src/Test/Haddock/Xhtml.hs index bca2c4cc..74d8c4f7 100644 --- a/haddock-test/src/Test/Haddock/Xhtml.hs +++ b/haddock-test/src/Test/Haddock/Xhtml.hs @@ -23,8 +23,9 @@ import Data.Char ( isSpace ) newtype Xml = Xml { unXml :: String } -- | Part of parsing involves dropping the @DOCTYPE@ line +-- and windows newline endings parseXml :: String -> Maybe Xml -parseXml = Just . Xml . dropDocTypeLine +parseXml = Just . Xml . filter (/= '\r') . dropDocTypeLine where dropDocTypeLine bs | "<!DOCTYPE" `isPrefixOf` bs |