From b8dcf173c272ebf85bbf2b427f84522e1474d092 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 11 Apr 2012 07:54:33 +0200 Subject: Add support for hyperlink labels to parser --- tests/unit-tests/parsetests.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs index 7180a79e..0192ebfc 100644 --- a/tests/unit-tests/parsetests.hs +++ b/tests/unit-tests/parsetests.hs @@ -9,6 +9,7 @@ import Haddock.Lex (tokenise) import Haddock.Parse (parseParas) import Haddock.Types import Outputable +import Data.Monoid instance Outputable a => Show a where show = showSDoc . ppr @@ -53,8 +54,21 @@ tests = [ input = ">>> putFooBar\nfoo\n\nbar" , result = Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]] } + + -- tests for links + , ParseTest { + input = "" + , result = Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n" + } + + , ParseTest { + input = "" + , result = Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n" + } ] +hyperlink :: String -> Maybe String -> Doc RdrName +hyperlink url = DocHyperlink . Hyperlink url main :: IO () main = do -- cgit v1.2.3 From 108f1588d31c9f7b90f31b15be4489e6067982b0 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Thu, 12 Apr 2012 08:23:05 +0200 Subject: Add golden test for hyperlinks --- tests/html-tests/tests/Hyperlinks.hs | 8 +++ tests/html-tests/tests/Hyperlinks.html.ref | 89 +++++++++++++++++++++++++ tests/html-tests/tests/mini_Hyperlinks.html.ref | 31 +++++++++ 3 files changed, 128 insertions(+) create mode 100644 tests/html-tests/tests/Hyperlinks.hs create mode 100644 tests/html-tests/tests/Hyperlinks.html.ref create mode 100644 tests/html-tests/tests/mini_Hyperlinks.html.ref (limited to 'tests') diff --git a/tests/html-tests/tests/Hyperlinks.hs b/tests/html-tests/tests/Hyperlinks.hs new file mode 100644 index 00000000..34e64448 --- /dev/null +++ b/tests/html-tests/tests/Hyperlinks.hs @@ -0,0 +1,8 @@ +module Hyperlinks where + +-- | +-- A plain URL: +-- +-- A URL with a label: +foo :: Int +foo = 23 diff --git a/tests/html-tests/tests/Hyperlinks.html.ref b/tests/html-tests/tests/Hyperlinks.html.ref new file mode 100644 index 00000000..59ec6c26 --- /dev/null +++ b/tests/html-tests/tests/Hyperlinks.html.ref @@ -0,0 +1,89 @@ + +Hyperlinks
Safe HaskellNone

Hyperlinks

Synopsis

Documentation

foo :: Int

A plain URL: http://example.com/ +

A URL with a label: some link +

diff --git a/tests/html-tests/tests/mini_Hyperlinks.html.ref b/tests/html-tests/tests/mini_Hyperlinks.html.ref new file mode 100644 index 00000000..f0c7d65a --- /dev/null +++ b/tests/html-tests/tests/mini_Hyperlinks.html.ref @@ -0,0 +1,31 @@ + +Hyperlinks

Hyperlinks

-- cgit v1.2.3 From 1483f369caaacc25e07f9715b15e49c35205b417 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 16 May 2012 13:37:02 +0200 Subject: Use LANGUAGE pragmas instead of default-extensions in cabal file --- haddock.cabal | 4 ---- src/.ghci | 2 +- src/Haddock/Interface/AttachInstances.hs | 2 +- src/Haddock/InterfaceFile.hs | 2 +- src/Haddock/Utils.hs | 1 + src/Main.hs | 2 +- tests/unit-tests/.ghci | 2 +- 7 files changed, 6 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/haddock.cabal b/haddock.cabal index 9d6f1a9b..609df296 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -104,8 +104,6 @@ executable haddock main-is: Main.hs hs-source-dirs: src - default-extensions: CPP, DeriveDataTypeable, - ScopedTypeVariables, MagicHash ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs other-modules: @@ -165,8 +163,6 @@ library build-depends: QuickCheck >= 2.1 && < 3 hs-source-dirs: src - default-extensions: CPP, DeriveDataTypeable, - ScopedTypeVariables, MagicHash ghc-options: -funbox-strict-fields -O2 -Wall -fwarn-tabs exposed-modules: diff --git a/src/.ghci b/src/.ghci index f00e6d55..3e83f04c 100644 --- a/src/.ghci +++ b/src/.ghci @@ -1 +1 @@ -:set -i../dist/build/autogen -i../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../dist/build/autogen/cabal_macros.h -XCPP -XDeriveDataTypeable -XScopedTypeVariables -XMagicHash +:set -i../dist/build/autogen -i../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../dist/build/autogen/cabal_macros.h diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs index c012f2e0..d9f4350f 100644 --- a/src/Haddock/Interface/AttachInstances.hs +++ b/src/Haddock/Interface/AttachInstances.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE MagicHash #-} +{-# LANGUAGE CPP, MagicHash #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.AttachInstances diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index ebe15325..7abb0583 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | diff --git a/src/Haddock/Utils.hs b/src/Haddock/Utils.hs index ad61e88a..ef1b0469 100644 --- a/src/Haddock/Utils.hs +++ b/src/Haddock/Utils.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Utils diff --git a/src/Main.hs b/src/Main.hs index 8c15661d..52406821 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -1,5 +1,5 @@ {-# OPTIONS_GHC -Wwarn #-} -{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE CPP, ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- | -- Module : Main diff --git a/tests/unit-tests/.ghci b/tests/unit-tests/.ghci index 10563664..dcc5b13d 100644 --- a/tests/unit-tests/.ghci +++ b/tests/unit-tests/.ghci @@ -1 +1 @@ -:set -i../../src -i../../dist/build/autogen -i../../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../../dist/build/autogen/cabal_macros.h -XCPP -XDeriveDataTypeable -XScopedTypeVariables -XMagicHash +:set -i../../src -i../../dist/build/autogen -i../../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../../dist/build/autogen/cabal_macros.h -- cgit v1.2.3 From d7adab3dbda0fc2ebabc2374adf5fab3ecd790ef Mon Sep 17 00:00:00 2001 From: Roman Cheplyaka Date: Wed, 20 Jun 2012 14:08:04 +0300 Subject: Tests for hiding instances (#37) --- tests/html-tests/tests/HiddenInstances.hs | 35 +++++ tests/html-tests/tests/HiddenInstances.html.ref | 169 ++++++++++++++++++++++++ 2 files changed, 204 insertions(+) create mode 100644 tests/html-tests/tests/HiddenInstances.hs create mode 100644 tests/html-tests/tests/HiddenInstances.html.ref (limited to 'tests') diff --git a/tests/html-tests/tests/HiddenInstances.hs b/tests/html-tests/tests/HiddenInstances.hs new file mode 100644 index 00000000..99a6c2fd --- /dev/null +++ b/tests/html-tests/tests/HiddenInstances.hs @@ -0,0 +1,35 @@ +-- http://trac.haskell.org/haddock/ticket/37 +module HiddenInstances (VisibleClass, VisibleData) where + +-- | Should be visible +class VisibleClass a + +-- | Should *not* be visible +class HiddenClass a + +-- | Should *not* be visible +data HiddenData = HiddenData + +-- | Should be visible +data VisibleData = VisibleData + +-- | Should be visible +instance VisibleClass Int + +-- | Should be visible +instance VisibleClass VisibleData + +-- | Should be visible +instance Num VisibleData + +-- | Should *not* be visible +instance VisibleClass HiddenData + +-- | Should *not* be visible +instance HiddenClass Int + +-- | Should *not* be visible +instance HiddenClass VisibleData + +-- | Should *not* be visible +instance HiddenClass HiddenData diff --git a/tests/html-tests/tests/HiddenInstances.html.ref b/tests/html-tests/tests/HiddenInstances.html.ref new file mode 100644 index 00000000..c1b75927 --- /dev/null +++ b/tests/html-tests/tests/HiddenInstances.html.ref @@ -0,0 +1,169 @@ + +HiddenInstances
Safe HaskellNone

HiddenInstances

Synopsis

Documentation

class VisibleClass a

Should be visible +

Instances

VisibleClass Int

Should be visible +

VisibleClass VisibleData

Should be visible +

data VisibleData

Should be visible +

Instances

Num VisibleData

Should be visible +

VisibleClass VisibleData

Should be visible +

-- cgit v1.2.3 From 8fe6416bcc1078540c21984cee7ef453dd9f1cfb Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 20 Jun 2012 15:42:35 +0200 Subject: Add an other test for hiding instances (#37) --- tests/html-tests/tests/HiddenInstancesA.hs | 17 +++ tests/html-tests/tests/HiddenInstancesB.hs | 2 + tests/html-tests/tests/HiddenInstancesB.html.ref | 143 +++++++++++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 tests/html-tests/tests/HiddenInstancesA.hs create mode 100644 tests/html-tests/tests/HiddenInstancesB.hs create mode 100644 tests/html-tests/tests/HiddenInstancesB.html.ref (limited to 'tests') diff --git a/tests/html-tests/tests/HiddenInstancesA.hs b/tests/html-tests/tests/HiddenInstancesA.hs new file mode 100644 index 00000000..f1775208 --- /dev/null +++ b/tests/html-tests/tests/HiddenInstancesA.hs @@ -0,0 +1,17 @@ +{-# OPTIONS_HADDOCK hide #-} +module HiddenInstancesA where + +-- | Should be visible +class Foo a + +-- | Should be visible +data Bar + +-- | Should be visible +instance Foo Bar + +-- | Should *not* be visible +data Baz + +-- | Should *not* be visible +instance Foo Baz diff --git a/tests/html-tests/tests/HiddenInstancesB.hs b/tests/html-tests/tests/HiddenInstancesB.hs new file mode 100644 index 00000000..eabf0637 --- /dev/null +++ b/tests/html-tests/tests/HiddenInstancesB.hs @@ -0,0 +1,2 @@ +module HiddenInstancesB (Foo, Bar) where +import HiddenInstancesA diff --git a/tests/html-tests/tests/HiddenInstancesB.html.ref b/tests/html-tests/tests/HiddenInstancesB.html.ref new file mode 100644 index 00000000..4d037bec --- /dev/null +++ b/tests/html-tests/tests/HiddenInstancesB.html.ref @@ -0,0 +1,143 @@ + +HiddenInstancesB
Safe HaskellNone

HiddenInstancesB

Synopsis

Documentation

class Foo a

Should be visible +

Instances

Foo Bar

Should be visible +

data Bar

Should be visible +

Instances

Foo Bar

Should be visible +

-- cgit v1.2.3 From dd941462345ad638fd00d661e2a3ca239a259ab2 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 25 Aug 2012 13:49:04 +0200 Subject: accept.hs: Ignore some files --- .gitignore | 4 ---- tests/html-tests/accept.hs | 9 ++++++++- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/.gitignore b/.gitignore index 9bf92b20..7fcbdc38 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,2 @@ /dist/ /doc/haddock -/tests/html-tests/output/ -/tests/html-tests/tests/doc-index.html.ref -/tests/html-tests/tests/index-frames.html.ref -/tests/html-tests/tests/index.html.ref diff --git a/tests/html-tests/accept.hs b/tests/html-tests/accept.hs index 49da5c5a..45b32078 100644 --- a/tests/html-tests/accept.hs +++ b/tests/html-tests/accept.hs @@ -5,17 +5,24 @@ import System.Exit import System.Directory import Data.List import Control.Monad +import Control.Applicative main = do args <- getArgs dir <- getCurrentDirectory - contents <- getDirectoryContents (dir "output") + contents <- filter (`notElem` ignore) <$> getDirectoryContents (dir "output") if not $ null args then mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] else mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file ] + where + ignore = [ + "doc-index.html" + , "index-frames.html" + , "index.html" + ] copy file = do -- cgit v1.2.3 From 62ecd8bdb0c9e1860f676d8ff793621ef56e477d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sat, 25 Aug 2012 13:30:41 +0200 Subject: Update reference renderings (bump version) --- tests/html-tests/tests/A.html.ref | 2 +- tests/html-tests/tests/B.html.ref | 2 +- tests/html-tests/tests/Bug1.html.ref | 2 +- tests/html-tests/tests/Bug2.html.ref | 2 +- tests/html-tests/tests/Bug3.html.ref | 2 +- tests/html-tests/tests/Bug4.html.ref | 2 +- tests/html-tests/tests/Bug6.html.ref | 2 +- tests/html-tests/tests/Bug7.html.ref | 2 +- tests/html-tests/tests/Bug8.html.ref | 2 +- tests/html-tests/tests/BugDeprecated.html.ref | 2 +- tests/html-tests/tests/BugExportHeadings.html.ref | 2 +- tests/html-tests/tests/Bugs.html.ref | 2 +- tests/html-tests/tests/CrossPackageDocs.html.ref | 2 +- tests/html-tests/tests/DeprecatedClass.html.ref | 2 +- tests/html-tests/tests/DeprecatedData.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction2.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction3.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule2.html.ref | 2 +- tests/html-tests/tests/DeprecatedNewtype.html.ref | 2 +- tests/html-tests/tests/DeprecatedRecord.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeFamily.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeSynonym.html.ref | 2 +- tests/html-tests/tests/Examples.html.ref | 2 +- tests/html-tests/tests/FunArgs.html.ref | 2 +- tests/html-tests/tests/GADTRecords.html.ref | 2 +- tests/html-tests/tests/Hash.html.ref | 2 +- tests/html-tests/tests/Hyperlinks.html.ref | 2 +- tests/html-tests/tests/IgnoreExports.html.ref | 2 +- tests/html-tests/tests/ModuleWithWarning.html.ref | 2 +- tests/html-tests/tests/NamedDoc.html.ref | 2 +- tests/html-tests/tests/NoLayout.html.ref | 2 +- tests/html-tests/tests/NonGreedy.html.ref | 2 +- tests/html-tests/tests/PruneWithWarning.html.ref | 2 +- tests/html-tests/tests/QuasiExpr.html.ref | 2 +- tests/html-tests/tests/QuasiQuote.html.ref | 2 +- tests/html-tests/tests/TH.html.ref | 2 +- tests/html-tests/tests/TH2.html.ref | 2 +- tests/html-tests/tests/Test.html.ref | 2 +- tests/html-tests/tests/Ticket112.html.ref | 2 +- tests/html-tests/tests/Ticket61.html.ref | 2 +- tests/html-tests/tests/Ticket75.html.ref | 2 +- tests/html-tests/tests/TypeFamilies.html.ref | 2 +- tests/html-tests/tests/TypeOperators.html.ref | 2 +- tests/html-tests/tests/Unicode.html.ref | 2 +- tests/html-tests/tests/Visible.html.ref | 2 +- 47 files changed, 47 insertions(+), 47 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/tests/A.html.ref b/tests/html-tests/tests/A.html.ref index 424ce52c..ec9dc975 100644 --- a/tests/html-tests/tests/A.html.ref +++ b/tests/html-tests/tests/A.html.ref @@ -176,7 +176,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_A.html");}; >

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.10.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Produced by Haddock version 2.11.0

version 2.12.0

Date: Sun, 26 Aug 2012 13:41:32 +0200 Subject: Update reference renderings (remove links for ()) --- tests/html-tests/tests/FunArgs.html.ref | 4 +-- tests/html-tests/tests/Hash.html.ref | 8 ++--- tests/html-tests/tests/Test.html.ref | 52 +++++++-------------------------- 3 files changed, 13 insertions(+), 51 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/tests/FunArgs.html.ref b/tests/html-tests/tests/FunArgs.html.ref index f3f00f43..0c551487 100644 --- a/tests/html-tests/tests/FunArgs.html.ref +++ b/tests/html-tests/tests/FunArgs.html.ref @@ -105,9 +105,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_FunArgs.html");}; >-> ()-> ()

Result diff --git a/tests/html-tests/tests/Hash.html.ref b/tests/html-tests/tests/Hash.html.ref index 4fbca19a..889ec1d9 100644 --- a/tests/html-tests/tests/Hash.html.ref +++ b/tests/html-tests/tests/Hash.html.ref @@ -113,9 +113,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Hash.html");}; >Hash key) => key -> val -> IO () ()

  • lookupHash key) => key -> val -> IO ()

    ()

    Inserts a new element into the hash table diff --git a/tests/html-tests/tests/Test.html.ref b/tests/html-tests/tests/Test.html.ref index ea3b193a..3ee3706b 100644 --- a/tests/html-tests/tests/Test.html.ref +++ b/tests/html-tests/tests/Test.html.ref @@ -410,11 +410,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Test.html");}; >Float -> T5 () ()

  • () ()
  • uk :: T () () -> () () -> T2 IntFloat) -> T5 () () -> () () -> IO ()
  • ()
  • lR -> N1 () -> () -> IO IntFloat -> T5 () () () ()
     
    :: T () () () ()

    This argument has type -> T5 () () () ()

    This argument has a very long description that should @@ -2055,9 +2027,7 @@ test2 >-> IO () ()

    This is the result type @@ -2135,9 +2105,7 @@ test2 >-> N1 () ()

    one of the arguments -- cgit v1.2.3 From a427422fae865a06f5fa23d904e7e12cc5b1af6e Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 26 Aug 2012 13:54:24 +0200 Subject: Update documentation of `runInteractiveProcess` in reference rendering --- tests/html-tests/tests/CrossPackageDocs.html.ref | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/html-tests/tests/CrossPackageDocs.html.ref b/tests/html-tests/tests/CrossPackageDocs.html.ref index f57f0e70..57bf900d 100644 --- a/tests/html-tests/tests/CrossPackageDocs.html.ref +++ b/tests/html-tests/tests/CrossPackageDocs.html.ref @@ -358,7 +358,11 @@ defined in the

    Filename of the executable + >Filename of the executable (see proc for details)

    Date: Fri, 21 Sep 2012 14:22:32 +0200 Subject: Disable Unicode test for now --- tests/html-tests/tests/Unicode.hs | 6 ------ tests/html-tests/tests/Unicode.hs.disabled | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 tests/html-tests/tests/Unicode.hs create mode 100644 tests/html-tests/tests/Unicode.hs.disabled (limited to 'tests') diff --git a/tests/html-tests/tests/Unicode.hs b/tests/html-tests/tests/Unicode.hs deleted file mode 100644 index d5bbf445..00000000 --- a/tests/html-tests/tests/Unicode.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Unicode where - --- | γλώσσα -x :: Int -x = 1 - diff --git a/tests/html-tests/tests/Unicode.hs.disabled b/tests/html-tests/tests/Unicode.hs.disabled new file mode 100644 index 00000000..d5bbf445 --- /dev/null +++ b/tests/html-tests/tests/Unicode.hs.disabled @@ -0,0 +1,6 @@ +module Unicode where + +-- | γλώσσα +x :: Int +x = 1 + -- cgit v1.2.3 From 605502fbd9879268a13bf5f400d98b128fb8d1fc Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Fri, 21 Sep 2012 14:35:45 +0200 Subject: Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! --- tests/html-tests/tests/TypeOperators.hs | 4 +- tests/html-tests/tests/TypeOperators.html.ref | 54 ---------------------- tests/html-tests/tests/mini_TypeOperators.html.ref | 8 ---- 3 files changed, 1 insertion(+), 65 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/tests/TypeOperators.hs b/tests/html-tests/tests/TypeOperators.hs index aa0fbe8c..edbb9344 100644 --- a/tests/html-tests/tests/TypeOperators.hs +++ b/tests/html-tests/tests/TypeOperators.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE TypeOperators #-} module TypeOperators ( -- * stuff (:-:), @@ -5,7 +6,6 @@ module TypeOperators ( Op, O(..), biO, - Flip(..) ) where data a :-: b @@ -18,5 +18,3 @@ newtype (g `O` f) a = O { unO :: g (f a) } biO :: (g `O` f) a biO = undefined - -newtype Flip (~>) b a = Flip { unFlip :: a ~> b } diff --git a/tests/html-tests/tests/TypeOperators.html.ref b/tests/html-tests/tests/TypeOperators.html.ref index 0155ab0d..519547d6 100644 --- a/tests/html-tests/tests/TypeOperators.html.ref +++ b/tests/html-tests/tests/TypeOperators.html.ref @@ -94,20 +94,6 @@ window.onload = function () {pageLoad();setSynopsis("mini_TypeOperators.html");} > :: (g `O` f) a
  • newtype Flip (~>) b a = Flip {}
  • O` f) a

    newtype Flip (~>) b a

    Constructors

    Flip 

    Fields

    unFlip :: a ~> b
     

    data Flip (~>) b a

    Date: Fri, 21 Sep 2012 16:02:24 +0200 Subject: Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. --- tests/html-tests/tests/CrossPackageDocs.html.ref | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/tests/CrossPackageDocs.html.ref b/tests/html-tests/tests/CrossPackageDocs.html.ref index 57bf900d..39353720 100644 --- a/tests/html-tests/tests/CrossPackageDocs.html.ref +++ b/tests/html-tests/tests/CrossPackageDocs.html.ref @@ -328,16 +328,6 @@ defined in the  Monad (Either e)  Date: Thu, 27 Sep 2012 15:48:19 +0200 Subject: Update hidden instances tests. --- tests/html-tests/tests/HiddenInstances.html.ref | 4 ++-- tests/html-tests/tests/HiddenInstancesB.html.ref | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/tests/HiddenInstances.html.ref b/tests/html-tests/tests/HiddenInstances.html.ref index c1b75927..163008f6 100644 --- a/tests/html-tests/tests/HiddenInstances.html.ref +++ b/tests/html-tests/tests/HiddenInstances.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_HiddenInstances.html") >Index

     

    Produced by Haddock version 2.10.0

    version 2.12.0

    Produced by Haddock version 2.11.0

    version 2.12.0

    Date: Sat, 22 Sep 2012 14:15:53 +0200 Subject: Adapt parsetests for GHC 7.6.1 --- tests/unit-tests/parsetests.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs index 0192ebfc..58348a59 100644 --- a/tests/unit-tests/parsetests.hs +++ b/tests/unit-tests/parsetests.hs @@ -11,8 +11,10 @@ import Haddock.Types import Outputable import Data.Monoid +dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") + instance Outputable a => Show a where - show = showSDoc . ppr + show = showSDoc dynFlags . ppr deriving instance Show a => Show (Doc a) deriving instance Eq a =>Eq (Doc a) @@ -80,4 +82,4 @@ main = do toTestCase (ParseTest s r) = TestCase $ assertEqual s r (parse s) parse :: String -> Maybe (Doc RdrName) - parse s = parseParas $ tokenise (defaultDynFlags undefined) s (0,0) + parse s = parseParas $ tokenise dynFlags s (0,0) -- cgit v1.2.3 From 25badd84cf6e09f4e556c7511a78144d38578d9f Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 24 Sep 2012 10:07:44 +0200 Subject: Add test-suite section for parsetests to cabal file + get rid of HUnit dependency --- haddock.cabal | 28 +++++++++ tests/nanospec/README | 6 ++ tests/nanospec/Test/Hspec.hs | 126 ++++++++++++++++++++++++++++++++++++++ tests/unit-tests/.ghci | 1 - tests/unit-tests/parsetests.hs | 125 ++++++++++++++++--------------------- tests/unit-tests/runparsetests.sh | 15 ----- 6 files changed, 214 insertions(+), 87 deletions(-) create mode 100644 tests/nanospec/README create mode 100644 tests/nanospec/Test/Hspec.hs delete mode 100644 tests/unit-tests/.ghci delete mode 100755 tests/unit-tests/runparsetests.sh (limited to 'tests') diff --git a/haddock.cabal b/haddock.cabal index f70d6813..3486b2f7 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -212,6 +212,34 @@ test-suite html-tests hs-source-dirs: tests/html-tests build-depends: base, directory, process, filepath, Cabal +test-suite spec + type: exitcode-stdio-1.0 + default-language: Haskell2010 + main-is: parsetests.hs + hs-source-dirs: + tests/unit-tests + , tests/nanospec + , src + + build-depends: + base + , ghc + , containers + , array + + -- NOTE: As of this writing, Cabal does not properly handle alex/happy for + -- test suites. We work around this by adding dist/build to hs-source-dirs, + -- so that the the generated lexer/parser from the library is used. I + -- addition we depend on 'haddock', so that the library is compiled before + -- the test suite. + -- + -- The corresponding cabal ticket is here: + -- https://github.com/haskell/cabal/issues/943 + hs-source-dirs: + dist/build + build-depends: + haddock + source-repository head type: git location: http://darcs.haskell.org/haddock.git diff --git a/tests/nanospec/README b/tests/nanospec/README new file mode 100644 index 00000000..ffce7c74 --- /dev/null +++ b/tests/nanospec/README @@ -0,0 +1,6 @@ +A lightweight implementation of a subset of Hspec's API with minimal +dependencies. + +http://hackage.haskell.org/package/nanospec + +This is a copy of version 0.1.0. diff --git a/tests/nanospec/Test/Hspec.hs b/tests/nanospec/Test/Hspec.hs new file mode 100644 index 00000000..904ce2e0 --- /dev/null +++ b/tests/nanospec/Test/Hspec.hs @@ -0,0 +1,126 @@ +{-# LANGUAGE DeriveDataTypeable, CPP #-} +-- | A lightweight implementation of a subset of Hspec's API. +module Test.Hspec ( +-- * Types + SpecM +, Spec + +-- * Defining a spec +, describe +, context +, it + +-- ** Setting expectations +, Expectation +, expect +, shouldBe +, shouldReturn + +-- * Running a spec +, hspec +) where + +import Control.Applicative +import Control.Monad +import Data.Monoid +import Data.List (intercalate) +import Data.Typeable +import qualified Control.Exception as E +import System.Exit + +-- a writer monad +data SpecM a = SpecM a [SpecTree] + +add :: SpecTree -> SpecM () +add s = SpecM () [s] + +instance Monad SpecM where + return a = SpecM a [] + SpecM a xs >>= f = case f a of + SpecM b ys -> SpecM b (xs ++ ys) + +data SpecTree = SpecGroup String Spec + | SpecExample String (IO Result) + +data Result = Success | Failure String + deriving (Eq, Show) + +type Spec = SpecM () + +describe :: String -> Spec -> Spec +describe label = add . SpecGroup label + +context :: String -> Spec -> Spec +context = describe + +it :: String -> Expectation -> Spec +it label = add . SpecExample label . evaluateExpectation + +-- | Summary of a test run. +data Summary = Summary Int Int + +instance Monoid Summary where + mempty = Summary 0 0 + (Summary x1 x2) `mappend` (Summary y1 y2) = Summary (x1 + y1) (x2 + y2) + +runSpec :: Spec -> IO Summary +runSpec = runForrest [] + where + runForrest :: [String] -> Spec -> IO Summary + runForrest labels (SpecM () xs) = mconcat <$> mapM (runTree labels) xs + + runTree :: [String] -> SpecTree -> IO Summary + runTree labels spec = case spec of + SpecExample label x -> do + putStr $ "/" ++ (intercalate "/" . reverse) (label:labels) ++ "/ " + r <- x + case r of + Success -> do + putStrLn "OK" + return (Summary 1 0) + Failure err -> do + putStrLn "FAILED" + putStrLn err + return (Summary 1 1) + SpecGroup label xs -> do + runForrest (label:labels) xs + +hspec :: Spec -> IO () +hspec spec = do + Summary total failures <- runSpec spec + putStrLn (show total ++ " example(s), " ++ show failures ++ " failure(s)") + when (failures /= 0) exitFailure + +type Expectation = IO () + +infix 1 `shouldBe`, `shouldReturn` + +shouldBe :: (Show a, Eq a) => a -> a -> Expectation +actual `shouldBe` expected = + expect ("expected: " ++ show expected ++ "\n but got: " ++ show actual) (actual == expected) + +shouldReturn :: (Show a, Eq a) => IO a -> a -> Expectation +action `shouldReturn` expected = action >>= (`shouldBe` expected) + +expect :: String -> Bool -> Expectation +expect label f + | f = return () + | otherwise = E.throwIO (ExpectationFailure label) + +data ExpectationFailure = ExpectationFailure String + deriving (Show, Eq, Typeable) + +instance E.Exception ExpectationFailure + +evaluateExpectation :: Expectation -> IO Result +evaluateExpectation action = (action >> return Success) + `E.catches` [ + -- Re-throw AsyncException, otherwise execution will not terminate on SIGINT + -- (ctrl-c). All AsyncExceptions are re-thrown (not just UserInterrupt) + -- because all of them indicate severe conditions and should not occur during + -- normal operation. + E.Handler $ \e -> E.throw (e :: E.AsyncException) + + , E.Handler $ \(ExpectationFailure err) -> return (Failure err) + , E.Handler $ \e -> (return . Failure) ("*** Exception: " ++ show (e :: E.SomeException)) + ] diff --git a/tests/unit-tests/.ghci b/tests/unit-tests/.ghci deleted file mode 100644 index dcc5b13d..00000000 --- a/tests/unit-tests/.ghci +++ /dev/null @@ -1 +0,0 @@ -:set -i../../src -i../../dist/build/autogen -i../../dist/build/haddock/haddock-tmp/ -packageghc -optP-include -optP../../dist/build/autogen/cabal_macros.h diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs index 58348a59..4a6c8d90 100644 --- a/tests/unit-tests/parsetests.hs +++ b/tests/unit-tests/parsetests.hs @@ -1,16 +1,17 @@ {-# LANGUAGE StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -module Main (main) where - -import Test.HUnit -import RdrName (RdrName) -import DynFlags (defaultDynFlags) -import Haddock.Lex (tokenise) -import Haddock.Parse (parseParas) -import Haddock.Types -import Outputable -import Data.Monoid - +module Main (main, spec) where + +import Test.Hspec +import RdrName (RdrName) +import DynFlags (DynFlags, defaultDynFlags) +import Haddock.Lex (tokenise) +import Haddock.Parse (parseParas) +import Haddock.Types +import Outputable +import Data.Monoid + +dynFlags :: DynFlags dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") instance Outputable a => Show a where @@ -19,67 +20,49 @@ instance Outputable a => Show a where deriving instance Show a => Show (Doc a) deriving instance Eq a =>Eq (Doc a) -data ParseTest = ParseTest { - input :: String - , result :: (Maybe (Doc RdrName)) - } - -tests :: [ParseTest] -tests = [ - ParseTest { - input = "foobar" - , result = Just $ DocParagraph $ DocString "foobar\n" - } - - , ParseTest { - input = "foobar\n\n>>> fib 10\n55" - , result = Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]]) - } - - , ParseTest { - input = "foobar\n>>> fib 10\n55" - , result = Nothing -- parse error - } - - , ParseTest { - input = "foobar\n\n> some code" - , result = Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n"))) - } - - , ParseTest { - input = "foobar\n> some code" - , result = Nothing -- parse error - } - - -- test support - , ParseTest { - input = ">>> putFooBar\nfoo\n\nbar" - , result = Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]] - } - - -- tests for links - , ParseTest { - input = "" - , result = Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n" - } - - , ParseTest { - input = "" - , result = Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n" - } - ] - -hyperlink :: String -> Maybe String -> Doc RdrName -hyperlink url = DocHyperlink . Hyperlink url +parse :: String -> Maybe (Doc RdrName) +parse s = parseParas $ tokenise dynFlags s (0,0) main :: IO () -main = do - _ <- runTestTT $ TestList $ map toTestCase tests - return (); - where +main = hspec spec + +spec :: Spec +spec = do + describe "parseParas" $ do + + it "parses a paragraph" $ do + parse "foobar" `shouldBe` (Just . DocParagraph . DocString) "foobar\n" + + context "when parsing an example" $ do + + it "requires an example to be separated from a previous paragrap by an empty line" $ do + parse "foobar\n\n>>> fib 10\n55" `shouldBe` + (Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]])) - toTestCase :: ParseTest -> Test - toTestCase (ParseTest s r) = TestCase $ assertEqual s r (parse s) + -- parse error + parse "foobar\n>>> fib 10\n55" `shouldBe` Nothing - parse :: String -> Maybe (Doc RdrName) - parse s = parseParas $ tokenise dynFlags s (0,0) + it "parses a result line that only contains as an emptly line" $ do + parse ">>> putFooBar\nfoo\n\nbar" `shouldBe` + (Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]]) + + context "when parsing a code block" $ do + it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do + parse "foobar\n\n> some code" `shouldBe` + Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n"))) + + -- parse error + parse "foobar\n> some code" `shouldBe` Nothing + + + context "when parsing a URL" $ do + it "parses a URL" $ do + parse "" `shouldBe` + (Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n") + + it "accepts an optional label" $ do + parse "" `shouldBe` + (Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n") + where + hyperlink :: String -> Maybe String -> Doc RdrName + hyperlink url = DocHyperlink . Hyperlink url diff --git a/tests/unit-tests/runparsetests.sh b/tests/unit-tests/runparsetests.sh deleted file mode 100755 index ead0ccf5..00000000 --- a/tests/unit-tests/runparsetests.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -cd `dirname $0` - -runhaskell \ - -i../../src \ - -i../../dist/build/autogen \ - -i../../dist/build/haddock/haddock-tmp/ \ - -packageghc \ - -optP-include \ - -optP../../dist/build/autogen/cabal_macros.h \ - -XCPP \ - -XDeriveDataTypeable \ - -XScopedTypeVariables \ - -XMagicHash \ - parsetests.hs -- cgit v1.2.3 From dd6209a0a1adf9f2817075173cca99ac2379db2e Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 7 Oct 2012 16:44:06 +0200 Subject: Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. --- tests/html-tests/runtests.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs index 25e53d1a..fc9477ca 100644 --- a/tests/html-tests/runtests.hs +++ b/tests/html-tests/runtests.hs @@ -43,15 +43,19 @@ test = do _ -> filter ((==) ".hs" . takeExtension) contents let mods' = map (testDir ) mods + + env_ <- getEnvironment + let env = Just (("haddock_datadir", packageRoot) : env_) + putStrLn "" putStrLn "Haddock version: " h1 <- runProcess haddockPath ["--version"] Nothing - (Just [("haddock_datadir", packageRoot)]) Nothing Nothing Nothing + env Nothing Nothing Nothing waitForProcess h1 putStrLn "" putStrLn "GHC version: " h2 <- runProcess haddockPath ["--ghc-version"] Nothing - (Just [("haddock_datadir", packageRoot)]) Nothing Nothing Nothing + env Nothing Nothing Nothing waitForProcess h2 putStrLn "" @@ -77,7 +81,7 @@ test = do handle <- runProcess haddockPath (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') - Nothing (Just [("haddock_datadir", packageRoot)]) Nothing + Nothing env Nothing Nothing Nothing code <- waitForProcess handle -- cgit v1.2.3 From 5e746fa9e5dc4b210dab3b1fe1b120760b96f305 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 7 Oct 2012 17:05:45 +0200 Subject: cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. --- tests/html-tests/tests/CrossPackageDocs.hs | 3 +- tests/html-tests/tests/CrossPackageDocs.html.ref | 204 ++------------------- .../tests/mini_CrossPackageDocs.html.ref | 4 +- 3 files changed, 24 insertions(+), 187 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/tests/CrossPackageDocs.hs b/tests/html-tests/tests/CrossPackageDocs.hs index de55060e..4d529f79 100644 --- a/tests/html-tests/tests/CrossPackageDocs.hs +++ b/tests/html-tests/tests/CrossPackageDocs.hs @@ -1,3 +1,4 @@ -module CrossPackageDocs (map, Monad(..), runInteractiveProcess) where +module CrossPackageDocs (map, IsString(..), runInteractiveProcess) where import System.Process +import Data.String diff --git a/tests/html-tests/tests/CrossPackageDocs.html.ref b/tests/html-tests/tests/CrossPackageDocs.html.ref index 39353720..d0a306af 100644 --- a/tests/html-tests/tests/CrossPackageDocs.html.ref +++ b/tests/html-tests/tests/CrossPackageDocs.html.ref @@ -53,28 +53,16 @@ window.onload = function () {pageLoad();setSynopsis("mini_CrossPackageDocs.html" >class Monad m IsString a where
  • class Monad m IsString a where

    The Monad class defines the basic operations over a monad, -a concept from a branch of mathematics known as category theory. -From the perspective of a Haskell programmer, however, it is best to -think of a monad as an abstract datatype of actions. -Haskell's do expressions provide a convenient syntax for writing -monadic expressions. -

    Minimal complete definition: >>= and return. -

    Instances of Monad should satisfy the following laws: -

     return a >>= k  ==  k a
    - m >>= return  ==  m
    - m >>= (\x -> k x >>= h)  ==  (m >>= k) >>= h
    -

    Instances of both Monad and Functor should additionally satisfy the law: -

     fmap f xs  ==  xs >>= return . f
    -

    The instances of Monad for lists, Maybe and IO -defined in the Prelude satisfy these laws. + >Class for string-like datastructures; used by the overloaded string + extension (-foverloaded-strings in GHC).

    Methods

    (>>=) :: m a -> (a -> m b) -> m b

    Sequentially compose two actions, passing any value produced - by the first as an argument to the second. -

    (>>) :: m a -> m b -> m b

    Sequentially compose two actions, discarding any value produced - by the first, like sequencing operators (such as the semicolon) - in imperative languages. -

    return :: a -> m a

    Inject a value into the monadic type. -

    fail :: fromString :: String -> m a

    Fail with a message. This operation is not part of the - mathematical definition of a monad, but is invoked on pattern-match - failure in a do expression. -

    -> a

    Instances

    IsString [Char]classMonad m

    IsString a

    Date: Sun, 7 Oct 2012 17:46:08 +0200 Subject: runtests.hs: Fix some warnings --- tests/html-tests/runtests.hs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs index fc9477ca..9d5d0502 100644 --- a/tests/html-tests/runtests.hs +++ b/tests/html-tests/runtests.hs @@ -1,8 +1,9 @@ +import Prelude hiding (mod) import Control.Monad import Data.List import Data.Maybe import Distribution.InstalledPackageInfo -import Distribution.Package +import Distribution.Package (PackageName (..)) import Distribution.Simple.Compiler import Distribution.Simple.GHC import Distribution.Simple.PackageIndex @@ -14,10 +15,10 @@ import System.Directory import System.Environment import System.Exit import System.FilePath -import System.Process -import Text.Printf +import System.Process (runProcess, waitForProcess) +packageRoot, haddockPath, testSuiteRoot, testDir, outDir :: FilePath packageRoot = "." haddockPath = packageRoot "dist" "build" "haddock" "haddock" testSuiteRoot = packageRoot "tests" "html-tests" @@ -25,11 +26,13 @@ testDir = testSuiteRoot "tests" outDir = testSuiteRoot "output" +main :: IO () main = do test putStrLn "All tests passed!" +test :: IO () test = do x <- doesFileExist haddockPath unless x $ die "you need to run 'cabal build' successfully first" @@ -39,7 +42,7 @@ test = do let (opts, spec) = span ("-" `isPrefixOf`) args let mods = case spec of - x:_ | x /= "all" -> [x ++ ".hs"] + y:_ | y /= "all" -> [y ++ ".hs"] _ -> filter ((==) ".hs" . takeExtension) contents let mods' = map (testDir ) mods @@ -63,7 +66,6 @@ test = do ghcPath <- fmap init $ rawSystemStdout normal haddockPath ["--print-ghc-path"] (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf - let safeHead xs = case xs of x : _ -> Just x; [] -> Nothing let mkDep pkgName = maybe (error "Couldn't find test dependencies") id $ do let pkgs = lookupPackageName pkgIndex (PackageName pkgName) @@ -87,8 +89,11 @@ test = do code <- waitForProcess handle when (code /= ExitSuccess) $ error "Haddock run failed! Exiting." check mods (if not (null args) && args !! 0 == "all" then False else True) + where + safeHead xs = case xs of x : _ -> Just x; [] -> Nothing +check :: [FilePath] -> Bool -> IO () check modules strict = do forM_ modules $ \mod -> do let outfile = outDir dropExtension mod ++ ".html" @@ -108,8 +113,8 @@ check modules strict = do outfile' = outDir takeFileName outfile ++ ".nolinks" writeFile reffile' ref' writeFile outfile' out' - b <- programOnPath "colordiff" - if b + r <- programOnPath "colordiff" + if r then system $ "colordiff " ++ reffile' ++ " " ++ outfile' else system $ "diff " ++ reffile' ++ " " ++ outfile' if strict then exitFailure else return () @@ -119,8 +124,10 @@ check modules strict = do putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" +haddockEq :: String -> String -> Bool haddockEq file1 file2 = stripLinks file1 == stripLinks file2 +stripLinks :: String -> String stripLinks str = let prefix = " [] x : xs -> x : stripLinks xs +programOnPath :: FilePath -> IO Bool programOnPath p = do result <- findProgramLocation silent p return (isJust result) - -- cgit v1.2.3 From 13e5da9d435168a81060e6cc6a262a4fe5315934 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 7 Oct 2012 17:57:11 +0200 Subject: runtests.hs: Make -Wall proof --- tests/html-tests/runtests.hs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs index 9d5d0502..2f218d17 100644 --- a/tests/html-tests/runtests.hs +++ b/tests/html-tests/runtests.hs @@ -10,12 +10,13 @@ import Distribution.Simple.PackageIndex import Distribution.Simple.Program import Distribution.Simple.Utils import Distribution.Verbosity +import System.IO import System.Cmd import System.Directory import System.Environment import System.Exit import System.FilePath -import System.Process (runProcess, waitForProcess) +import System.Process (ProcessHandle, runProcess, waitForProcess) packageRoot, haddockPath, testSuiteRoot, testDir, outDir :: FilePath @@ -54,12 +55,12 @@ test = do putStrLn "Haddock version: " h1 <- runProcess haddockPath ["--version"] Nothing env Nothing Nothing Nothing - waitForProcess h1 + wait h1 "*** Running `haddock --version' failed!" putStrLn "" putStrLn "GHC version: " h2 <- runProcess haddockPath ["--ghc-version"] Nothing env Nothing Nothing Nothing - waitForProcess h2 + wait h2 "*** Running `haddock --ghc-version' failed!" putStrLn "" -- TODO: maybe do something more clever here using haddock.cabal @@ -86,12 +87,19 @@ test = do Nothing env Nothing Nothing Nothing - code <- waitForProcess handle - when (code /= ExitSuccess) $ error "Haddock run failed! Exiting." + wait handle "*** Haddock run failed! Exiting." check mods (if not (null args) && args !! 0 == "all" then False else True) where + + safeHead :: [a] -> Maybe a safeHead xs = case xs of x : _ -> Just x; [] -> Nothing + wait :: ProcessHandle -> String -> IO () + wait h msg = do + r <- waitForProcess h + unless (r == ExitSuccess) $ do + hPutStrLn stderr msg + exitFailure check :: [FilePath] -> Bool -> IO () check modules strict = do @@ -114,10 +122,13 @@ check modules strict = do writeFile reffile' ref' writeFile outfile' out' r <- programOnPath "colordiff" - if r + code <- if r then system $ "colordiff " ++ reffile' ++ " " ++ outfile' else system $ "diff " ++ reffile' ++ " " ++ outfile' if strict then exitFailure else return () + unless (code == ExitSuccess) $ do + hPutStrLn stderr "*** Running diff failed!" + exitFailure else do putStrLn $ "Pass: " ++ mod else do -- cgit v1.2.3 From bfaff48e91dd9f2f3d94739851ab18e7d872c7ff Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 7 Oct 2012 18:06:08 +0200 Subject: runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe --- tests/html-tests/runtests.hs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs index 2f218d17..28bf2f7e 100644 --- a/tests/html-tests/runtests.hs +++ b/tests/html-tests/runtests.hs @@ -68,12 +68,12 @@ test = do (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf let mkDep pkgName = - maybe (error "Couldn't find test dependencies") id $ do + fromMaybe (error "Couldn't find test dependencies") $ do let pkgs = lookupPackageName pkgIndex (PackageName pkgName) - (_, pkgs') <- safeHead pkgs - pkg <- safeHead pkgs' - ifacePath <- safeHead (haddockInterfaces pkg) - htmlPath <- safeHead (haddockHTMLs pkg) + (_, pkgs') <- listToMaybe pkgs + pkg <- listToMaybe pkgs' + ifacePath <- listToMaybe (haddockInterfaces pkg) + htmlPath <- listToMaybe (haddockHTMLs pkg) return ("-i " ++ htmlPath ++ "," ++ ifacePath) let base = mkDep "base" @@ -90,10 +90,6 @@ test = do wait handle "*** Haddock run failed! Exiting." check mods (if not (null args) && args !! 0 == "all" then False else True) where - - safeHead :: [a] -> Maybe a - safeHead xs = case xs of x : _ -> Just x; [] -> Nothing - wait :: ProcessHandle -> String -> IO () wait h msg = do r <- waitForProcess h -- cgit v1.2.3 From 0cf6d611f3af05c7b54d83747847d372a3ebf017 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 28 Aug 2012 08:51:57 +0200 Subject: Add HTML test for properties --- tests/html-tests/tests/Properties.hs | 9 +++ tests/html-tests/tests/Properties.html.ref | 92 +++++++++++++++++++++++++ tests/html-tests/tests/mini_Properties.html.ref | 31 +++++++++ 3 files changed, 132 insertions(+) create mode 100644 tests/html-tests/tests/Properties.hs create mode 100644 tests/html-tests/tests/Properties.html.ref create mode 100644 tests/html-tests/tests/mini_Properties.html.ref (limited to 'tests') diff --git a/tests/html-tests/tests/Properties.hs b/tests/html-tests/tests/Properties.hs new file mode 100644 index 00000000..05930ece --- /dev/null +++ b/tests/html-tests/tests/Properties.hs @@ -0,0 +1,9 @@ +module Properties where + +-- | Fibonacci number of given 'Integer'. +-- +-- prop> fib n <= fib (n + 1) +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) diff --git a/tests/html-tests/tests/Properties.html.ref b/tests/html-tests/tests/Properties.html.ref new file mode 100644 index 00000000..8fd918bf --- /dev/null +++ b/tests/html-tests/tests/Properties.html.ref @@ -0,0 +1,92 @@ + +Properties

    Monad [] 
    Monad IO 
    Monad Q 
    Monad Maybe 
    Monad PprM 
    Monad ((->) r) 
    Safe HaskellNone

    Properties

    Synopsis

    Documentation

    fib :: Integer -> Integer

    Fibonacci number of given Integer. +

    fib n <= fib (n + 1)
    diff --git a/tests/html-tests/tests/mini_Properties.html.ref b/tests/html-tests/tests/mini_Properties.html.ref new file mode 100644 index 00000000..5f538dfd --- /dev/null +++ b/tests/html-tests/tests/mini_Properties.html.ref @@ -0,0 +1,31 @@ + +Properties

    Properties

    -- cgit v1.2.3 From 48a078a6f3158470abbb2746a71d4659c768949e Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 9 Oct 2012 12:04:20 +0200 Subject: Add unit tests for properties --- tests/unit-tests/parsetests.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs index 4a6c8d90..1f923aa0 100644 --- a/tests/unit-tests/parsetests.hs +++ b/tests/unit-tests/parsetests.hs @@ -63,6 +63,17 @@ spec = do it "accepts an optional label" $ do parse "" `shouldBe` (Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n") + + context "when parsing properties" $ do + it "can parse a single property" $ do + parse "prop> 23 == 23" `shouldBe` (Just $ DocProperty "23 == 23") + + it "can parse a multiple subsequent properties" $ do + let input = unlines [ + "prop> 23 == 23" + , "prop> 42 == 42" + ] + parse input `shouldBe` (Just $ DocProperty "23 == 23" `DocAppend` DocProperty "42 == 42") where hyperlink :: String -> Maybe String -> Doc RdrName hyperlink url = DocHyperlink . Hyperlink url -- cgit v1.2.3 From 48a391729e2d00caf0b86d3612e34135a7379200 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Wed, 10 Oct 2012 11:16:01 +0200 Subject: Bump version --- doc/haddock.xml | 2 +- haddock.cabal | 2 +- haddock.spec | 2 +- tests/html-tests/tests/A.html.ref | 2 +- tests/html-tests/tests/B.html.ref | 2 +- tests/html-tests/tests/Bug1.html.ref | 2 +- tests/html-tests/tests/Bug2.html.ref | 2 +- tests/html-tests/tests/Bug3.html.ref | 2 +- tests/html-tests/tests/Bug4.html.ref | 2 +- tests/html-tests/tests/Bug6.html.ref | 2 +- tests/html-tests/tests/Bug7.html.ref | 2 +- tests/html-tests/tests/Bug8.html.ref | 2 +- tests/html-tests/tests/BugDeprecated.html.ref | 2 +- tests/html-tests/tests/BugExportHeadings.html.ref | 2 +- tests/html-tests/tests/Bugs.html.ref | 2 +- tests/html-tests/tests/CrossPackageDocs.html.ref | 2 +- tests/html-tests/tests/DeprecatedClass.html.ref | 2 +- tests/html-tests/tests/DeprecatedData.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction2.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction3.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule2.html.ref | 2 +- tests/html-tests/tests/DeprecatedNewtype.html.ref | 2 +- tests/html-tests/tests/DeprecatedRecord.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeFamily.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeSynonym.html.ref | 2 +- tests/html-tests/tests/Examples.html.ref | 2 +- tests/html-tests/tests/FunArgs.html.ref | 2 +- tests/html-tests/tests/GADTRecords.html.ref | 2 +- tests/html-tests/tests/Hash.html.ref | 2 +- tests/html-tests/tests/HiddenInstances.html.ref | 2 +- tests/html-tests/tests/HiddenInstancesB.html.ref | 2 +- tests/html-tests/tests/Hyperlinks.html.ref | 2 +- tests/html-tests/tests/IgnoreExports.html.ref | 2 +- tests/html-tests/tests/ModuleWithWarning.html.ref | 2 +- tests/html-tests/tests/NamedDoc.html.ref | 2 +- tests/html-tests/tests/NoLayout.html.ref | 2 +- tests/html-tests/tests/NonGreedy.html.ref | 2 +- tests/html-tests/tests/Properties.html.ref | 2 +- tests/html-tests/tests/PruneWithWarning.html.ref | 2 +- tests/html-tests/tests/QuasiExpr.html.ref | 2 +- tests/html-tests/tests/QuasiQuote.html.ref | 2 +- tests/html-tests/tests/TH.html.ref | 2 +- tests/html-tests/tests/TH2.html.ref | 2 +- tests/html-tests/tests/Test.html.ref | 2 +- tests/html-tests/tests/Ticket112.html.ref | 2 +- tests/html-tests/tests/Ticket61.html.ref | 2 +- tests/html-tests/tests/Ticket75.html.ref | 2 +- tests/html-tests/tests/TypeFamilies.html.ref | 2 +- tests/html-tests/tests/TypeOperators.html.ref | 2 +- tests/html-tests/tests/Unicode.html.ref | 2 +- tests/html-tests/tests/Visible.html.ref | 2 +- 53 files changed, 53 insertions(+), 53 deletions(-) (limited to 'tests') diff --git a/doc/haddock.xml b/doc/haddock.xml index a38b70cf..90946e12 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -21,7 +21,7 @@ Simon Marlow, David Waern - This document describes Haddock version 2.12.0, a Haskell + This document describes Haddock version 2.13.0, a Haskell documentation tool. diff --git a/haddock.cabal b/haddock.cabal index ec274445..d6864f85 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,5 +1,5 @@ name: haddock -version: 2.12.0 +version: 2.13.0 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries diff --git a/haddock.spec b/haddock.spec index d8821a4a..594d87b1 100644 --- a/haddock.spec +++ b/haddock.spec @@ -17,7 +17,7 @@ # version label of your release tarball. %define name haddock -%define version 2.12.0 +%define version 2.13.0 %define release 1 Name: %{name} diff --git a/tests/html-tests/tests/A.html.ref b/tests/html-tests/tests/A.html.ref index ec9dc975..17765b50 100644 --- a/tests/html-tests/tests/A.html.ref +++ b/tests/html-tests/tests/A.html.ref @@ -176,7 +176,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_A.html");}; >

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Produced by Haddock version 2.12.0

    version 2.13.0

    Date: Sat, 13 Oct 2012 13:40:59 +0200 Subject: Update version in html tests, rpm spec file, and user manual --- doc/haddock.xml | 2 +- haddock.spec | 2 +- tests/html-tests/tests/A.html.ref | 2 +- tests/html-tests/tests/B.html.ref | 2 +- tests/html-tests/tests/Bug1.html.ref | 2 +- tests/html-tests/tests/Bug2.html.ref | 2 +- tests/html-tests/tests/Bug3.html.ref | 2 +- tests/html-tests/tests/Bug4.html.ref | 2 +- tests/html-tests/tests/Bug6.html.ref | 2 +- tests/html-tests/tests/Bug7.html.ref | 2 +- tests/html-tests/tests/Bug8.html.ref | 2 +- tests/html-tests/tests/BugDeprecated.html.ref | 2 +- tests/html-tests/tests/BugExportHeadings.html.ref | 2 +- tests/html-tests/tests/Bugs.html.ref | 2 +- tests/html-tests/tests/CrossPackageDocs.html.ref | 2 +- tests/html-tests/tests/DeprecatedClass.html.ref | 2 +- tests/html-tests/tests/DeprecatedData.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction2.html.ref | 2 +- tests/html-tests/tests/DeprecatedFunction3.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule.html.ref | 2 +- tests/html-tests/tests/DeprecatedModule2.html.ref | 2 +- tests/html-tests/tests/DeprecatedNewtype.html.ref | 2 +- tests/html-tests/tests/DeprecatedRecord.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeFamily.html.ref | 2 +- tests/html-tests/tests/DeprecatedTypeSynonym.html.ref | 2 +- tests/html-tests/tests/Examples.html.ref | 2 +- tests/html-tests/tests/FunArgs.html.ref | 2 +- tests/html-tests/tests/GADTRecords.html.ref | 2 +- tests/html-tests/tests/Hash.html.ref | 2 +- tests/html-tests/tests/HiddenInstances.html.ref | 2 +- tests/html-tests/tests/HiddenInstancesB.html.ref | 2 +- tests/html-tests/tests/Hyperlinks.html.ref | 2 +- tests/html-tests/tests/IgnoreExports.html.ref | 2 +- tests/html-tests/tests/ModuleWithWarning.html.ref | 2 +- tests/html-tests/tests/NamedDoc.html.ref | 2 +- tests/html-tests/tests/NoLayout.html.ref | 2 +- tests/html-tests/tests/NonGreedy.html.ref | 2 +- tests/html-tests/tests/Properties.html.ref | 2 +- tests/html-tests/tests/PruneWithWarning.html.ref | 2 +- tests/html-tests/tests/QuasiExpr.html.ref | 2 +- tests/html-tests/tests/QuasiQuote.html.ref | 2 +- tests/html-tests/tests/TH.html.ref | 2 +- tests/html-tests/tests/TH2.html.ref | 2 +- tests/html-tests/tests/Test.html.ref | 2 +- tests/html-tests/tests/Ticket112.html.ref | 2 +- tests/html-tests/tests/Ticket61.html.ref | 2 +- tests/html-tests/tests/Ticket75.html.ref | 2 +- tests/html-tests/tests/TypeFamilies.html.ref | 2 +- tests/html-tests/tests/TypeOperators.html.ref | 2 +- tests/html-tests/tests/Unicode.html.ref | 2 +- tests/html-tests/tests/Visible.html.ref | 2 +- 52 files changed, 52 insertions(+), 52 deletions(-) (limited to 'tests') diff --git a/doc/haddock.xml b/doc/haddock.xml index 4620fc89..4e4447dc 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -21,7 +21,7 @@ Simon Marlow, David Waern - This document describes Haddock version 2.13.0, a Haskell + This document describes Haddock version 2.13.1, a Haskell documentation tool. diff --git a/haddock.spec b/haddock.spec index 594d87b1..401f1e8a 100644 --- a/haddock.spec +++ b/haddock.spec @@ -17,7 +17,7 @@ # version label of your release tarball. %define name haddock -%define version 2.13.0 +%define version 2.13.1 %define release 1 Name: %{name} diff --git a/tests/html-tests/tests/A.html.ref b/tests/html-tests/tests/A.html.ref index 17765b50..328fec02 100644 --- a/tests/html-tests/tests/A.html.ref +++ b/tests/html-tests/tests/A.html.ref @@ -176,7 +176,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_A.html");}; >

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Produced by Haddock version 2.13.0

    version 2.13.1

    Date: Sat, 13 Oct 2012 19:02:16 +0200 Subject: Handle HsExplicitListTy in renameer (fixes #213) --- src/Haddock/Interface/Rename.hs | 2 + tests/html-tests/tests/AdvanceTypes.hs | 9 +++ tests/html-tests/tests/AdvanceTypes.html.ref | 97 +++++++++++++++++++++++ tests/html-tests/tests/mini_AdvanceTypes.html.ref | 33 ++++++++ 4 files changed, 141 insertions(+) create mode 100644 tests/html-tests/tests/AdvanceTypes.hs create mode 100644 tests/html-tests/tests/AdvanceTypes.html.ref create mode 100644 tests/html-tests/tests/mini_AdvanceTypes.html.ref (limited to 'tests') diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 55c9a5da..4bdbcb76 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -271,6 +271,8 @@ renameType t = case t of HsTyLit x -> return (HsTyLit x) + HsExplicitListTy a b -> HsExplicitListTy a <$> mapM renameLType b + _ -> error "renameType" diff --git a/tests/html-tests/tests/AdvanceTypes.hs b/tests/html-tests/tests/AdvanceTypes.hs new file mode 100644 index 00000000..939fdf07 --- /dev/null +++ b/tests/html-tests/tests/AdvanceTypes.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE TypeOperators #-} +module AdvanceTypes where + +data Pattern :: [*] -> * where + Nil :: Pattern '[] + Cons :: Maybe h -> Pattern t -> Pattern (h ': t) diff --git a/tests/html-tests/tests/AdvanceTypes.html.ref b/tests/html-tests/tests/AdvanceTypes.html.ref new file mode 100644 index 00000000..bac545be --- /dev/null +++ b/tests/html-tests/tests/AdvanceTypes.html.ref @@ -0,0 +1,97 @@ + +AdvanceTypes
    Safe HaskellNone

    AdvanceTypes

    Documentation

    data Pattern where

    Constructors

    Nil :: Pattern `[]` 
    Cons :: Maybe h -> Pattern t -> Pattern (h : t) 
    diff --git a/tests/html-tests/tests/mini_AdvanceTypes.html.ref b/tests/html-tests/tests/mini_AdvanceTypes.html.ref new file mode 100644 index 00000000..59d8dcb1 --- /dev/null +++ b/tests/html-tests/tests/mini_AdvanceTypes.html.ref @@ -0,0 +1,33 @@ + +AdvanceTypes

    AdvanceTypes

    data Pattern

    -- cgit v1.2.3 From 6fafde62449fa8a5cb8405d6270caa5e1ddac613 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 01:51:32 +0200 Subject: Organize unite tests hierarchically --- haddock.cabal | 2 +- tests/unit-tests/Haddock/ParseSpec.hs | 79 +++++++++++++++++++++++++++++++++++ tests/unit-tests/Spec.hs | 9 ++++ tests/unit-tests/parsetests.hs | 79 ----------------------------------- 4 files changed, 89 insertions(+), 80 deletions(-) create mode 100644 tests/unit-tests/Haddock/ParseSpec.hs create mode 100644 tests/unit-tests/Spec.hs delete mode 100644 tests/unit-tests/parsetests.hs (limited to 'tests') diff --git a/haddock.cabal b/haddock.cabal index c0d77a10..b77fc5ac 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -179,7 +179,7 @@ test-suite html-tests test-suite spec type: exitcode-stdio-1.0 default-language: Haskell2010 - main-is: parsetests.hs + main-is: Spec.hs hs-source-dirs: tests/unit-tests , tests/nanospec diff --git a/tests/unit-tests/Haddock/ParseSpec.hs b/tests/unit-tests/Haddock/ParseSpec.hs new file mode 100644 index 00000000..0c959982 --- /dev/null +++ b/tests/unit-tests/Haddock/ParseSpec.hs @@ -0,0 +1,79 @@ +{-# LANGUAGE StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} +module Haddock.ParseSpec (main, spec) where + +import Test.Hspec +import RdrName (RdrName) +import DynFlags (DynFlags, defaultDynFlags) +import Haddock.Lex (tokenise) +import Haddock.Parse (parseParas) +import Haddock.Types +import Outputable +import Data.Monoid + +dynFlags :: DynFlags +dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") + +instance Outputable a => Show a where + show = showSDoc dynFlags . ppr + +deriving instance Show a => Show (Doc a) +deriving instance Eq a =>Eq (Doc a) + +parse :: String -> Maybe (Doc RdrName) +parse s = parseParas $ tokenise dynFlags s (0,0) + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "parseParas" $ do + + it "parses a paragraph" $ do + parse "foobar" `shouldBe` (Just . DocParagraph . DocString) "foobar\n" + + context "when parsing an example" $ do + + it "requires an example to be separated from a previous paragrap by an empty line" $ do + parse "foobar\n\n>>> fib 10\n55" `shouldBe` + (Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]])) + + -- parse error + parse "foobar\n>>> fib 10\n55" `shouldBe` Nothing + + it "parses a result line that only contains as an emptly line" $ do + parse ">>> putFooBar\nfoo\n\nbar" `shouldBe` + (Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]]) + + context "when parsing a code block" $ do + it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do + parse "foobar\n\n> some code" `shouldBe` + Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n"))) + + -- parse error + parse "foobar\n> some code" `shouldBe` Nothing + + + context "when parsing a URL" $ do + it "parses a URL" $ do + parse "" `shouldBe` + (Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n") + + it "accepts an optional label" $ do + parse "" `shouldBe` + (Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n") + + context "when parsing properties" $ do + it "can parse a single property" $ do + parse "prop> 23 == 23" `shouldBe` (Just $ DocProperty "23 == 23") + + it "can parse a multiple subsequent properties" $ do + let input = unlines [ + "prop> 23 == 23" + , "prop> 42 == 42" + ] + parse input `shouldBe` (Just $ DocProperty "23 == 23" `DocAppend` DocProperty "42 == 42") + where + hyperlink :: String -> Maybe String -> Doc RdrName + hyperlink url = DocHyperlink . Hyperlink url diff --git a/tests/unit-tests/Spec.hs b/tests/unit-tests/Spec.hs new file mode 100644 index 00000000..68521c03 --- /dev/null +++ b/tests/unit-tests/Spec.hs @@ -0,0 +1,9 @@ +module Main where + +import Test.Hspec + +import qualified Haddock.ParseSpec + +main :: IO () +main = hspec $ do + describe "Haddock.Parse" Haddock.ParseSpec.spec diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs deleted file mode 100644 index 1f923aa0..00000000 --- a/tests/unit-tests/parsetests.hs +++ /dev/null @@ -1,79 +0,0 @@ -{-# LANGUAGE StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} -{-# OPTIONS_GHC -fno-warn-orphans #-} -module Main (main, spec) where - -import Test.Hspec -import RdrName (RdrName) -import DynFlags (DynFlags, defaultDynFlags) -import Haddock.Lex (tokenise) -import Haddock.Parse (parseParas) -import Haddock.Types -import Outputable -import Data.Monoid - -dynFlags :: DynFlags -dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") - -instance Outputable a => Show a where - show = showSDoc dynFlags . ppr - -deriving instance Show a => Show (Doc a) -deriving instance Eq a =>Eq (Doc a) - -parse :: String -> Maybe (Doc RdrName) -parse s = parseParas $ tokenise dynFlags s (0,0) - -main :: IO () -main = hspec spec - -spec :: Spec -spec = do - describe "parseParas" $ do - - it "parses a paragraph" $ do - parse "foobar" `shouldBe` (Just . DocParagraph . DocString) "foobar\n" - - context "when parsing an example" $ do - - it "requires an example to be separated from a previous paragrap by an empty line" $ do - parse "foobar\n\n>>> fib 10\n55" `shouldBe` - (Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]])) - - -- parse error - parse "foobar\n>>> fib 10\n55" `shouldBe` Nothing - - it "parses a result line that only contains as an emptly line" $ do - parse ">>> putFooBar\nfoo\n\nbar" `shouldBe` - (Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]]) - - context "when parsing a code block" $ do - it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do - parse "foobar\n\n> some code" `shouldBe` - Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n"))) - - -- parse error - parse "foobar\n> some code" `shouldBe` Nothing - - - context "when parsing a URL" $ do - it "parses a URL" $ do - parse "" `shouldBe` - (Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n") - - it "accepts an optional label" $ do - parse "" `shouldBe` - (Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n") - - context "when parsing properties" $ do - it "can parse a single property" $ do - parse "prop> 23 == 23" `shouldBe` (Just $ DocProperty "23 == 23") - - it "can parse a multiple subsequent properties" $ do - let input = unlines [ - "prop> 23 == 23" - , "prop> 42 == 42" - ] - parse input `shouldBe` (Just $ DocProperty "23 == 23" `DocAppend` DocProperty "42 == 42") - where - hyperlink :: String -> Maybe String -> Doc RdrName - hyperlink url = DocHyperlink . Hyperlink url -- cgit v1.2.3 From 58c89fae6eabd7e190cbf64488b03b82a899029b Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 11:47:59 +0200 Subject: Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref --- .../html-tests/tests/mini_HiddenInstances.html.ref | 41 ++++++++++++++++++++++ .../tests/mini_HiddenInstancesB.html.ref | 41 ++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 tests/html-tests/tests/mini_HiddenInstances.html.ref create mode 100644 tests/html-tests/tests/mini_HiddenInstancesB.html.ref (limited to 'tests') diff --git a/tests/html-tests/tests/mini_HiddenInstances.html.ref b/tests/html-tests/tests/mini_HiddenInstances.html.ref new file mode 100644 index 00000000..0f1a2e04 --- /dev/null +++ b/tests/html-tests/tests/mini_HiddenInstances.html.ref @@ -0,0 +1,41 @@ + +HiddenInstances

    HiddenInstances

    diff --git a/tests/html-tests/tests/mini_HiddenInstancesB.html.ref b/tests/html-tests/tests/mini_HiddenInstancesB.html.ref new file mode 100644 index 00000000..3ce4f6a9 --- /dev/null +++ b/tests/html-tests/tests/mini_HiddenInstancesB.html.ref @@ -0,0 +1,41 @@ + +HiddenInstancesB

    HiddenInstancesB

    class Foo a

    data Bar

    -- cgit v1.2.3 From dfc2cb4e31d6756b2d6ca7f87e80d8913751a4b7 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 11:58:13 +0200 Subject: Allow haddock markup in deprecation messages --- haddock.cabal | 1 + src/Haddock/Interface/Create.hs | 49 +++++++++++++--------- src/Haddock/Parse.y | 2 +- src/Haddock/Types.hs | 39 ++++++++++++++++- tests/html-tests/tests/BugDeprecated.html.ref | 18 +++++--- tests/html-tests/tests/BugExportHeadings.html.ref | 9 ++-- tests/html-tests/tests/DeprecatedClass.html.ref | 12 ++++-- tests/html-tests/tests/DeprecatedData.html.ref | 18 +++++--- tests/html-tests/tests/DeprecatedFunction.hs | 8 +++- tests/html-tests/tests/DeprecatedFunction.html.ref | 28 ++++++++++++- .../html-tests/tests/DeprecatedFunction2.html.ref | 3 +- .../html-tests/tests/DeprecatedFunction3.html.ref | 3 +- tests/html-tests/tests/DeprecatedModule.hs | 2 +- tests/html-tests/tests/DeprecatedModule.html.ref | 5 ++- tests/html-tests/tests/DeprecatedModule2.html.ref | 3 +- tests/html-tests/tests/DeprecatedNewtype.html.ref | 12 ++++-- tests/html-tests/tests/DeprecatedRecord.html.ref | 3 +- .../html-tests/tests/DeprecatedTypeFamily.html.ref | 6 ++- .../tests/DeprecatedTypeSynonym.html.ref | 6 ++- tests/html-tests/tests/ModuleWithWarning.hs | 2 +- tests/html-tests/tests/ModuleWithWarning.html.ref | 5 ++- .../tests/mini_DeprecatedFunction.html.ref | 6 +++ 22 files changed, 179 insertions(+), 61 deletions(-) (limited to 'tests') diff --git a/haddock.cabal b/haddock.cabal index b77fc5ac..88c18cd3 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -189,6 +189,7 @@ test-suite spec base , ghc , containers + , deepseq , array -- NOTE: As of this writing, Cabal does not properly handle alex/happy for diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 32f287f5..fca1a00e 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -41,7 +41,7 @@ import Name import Bag import RdrName import TcRnTypes -import FastString (unpackFS) +import FastString (concatFS) -- | Use a 'TypecheckedModule' to produce an 'Interface'. @@ -90,7 +90,8 @@ createInterface tm flags modMap instIfaceMap = do liftErrMsg $ warnAboutFilteredDecls dflags mdl decls - let warningMap = mkWarningMap warnings gre exportedNames + warningMap <- liftErrMsg $ mkWarningMap dflags warnings gre exportedNames + exportItems <- mkExportItems modMap mdl warningMap gre exportedNames decls maps exports instances instIfaceMap dflags @@ -112,11 +113,13 @@ createInterface tm flags modMap instIfaceMap = do let !aliases = mkAliasMap dflags $ tm_renamed_source tm + modWarn <- liftErrMsg $ moduleWarning dflags gre warnings + return $! Interface { ifaceMod = mdl, ifaceOrigFilename = msHsFilePath ms, ifaceInfo = info, - ifaceDoc = Documentation mbDoc (moduleWarning warnings), + ifaceDoc = Documentation mbDoc modWarn, ifaceRnDoc = Documentation Nothing Nothing, ifaceOptions = opts, ifaceDocMap = docMap, @@ -169,29 +172,35 @@ lookupModuleDyn dflags Nothing mdlName = type WarningMap = DocMap Name -mkWarningMap :: Warnings -> GlobalRdrEnv -> [Name] -> WarningMap -mkWarningMap NoWarnings _ _ = M.empty -mkWarningMap (WarnAll _) _ _ = M.empty -mkWarningMap (WarnSome ws) gre exps = M.fromList - [ (n, warnToDoc w) | (occ, w) <- ws, elt <- lookupGlobalRdrEnv gre occ - , let n = gre_name elt, n `elem` exps ] +mkWarningMap :: DynFlags -> Warnings -> GlobalRdrEnv -> [Name] -> ErrMsgM WarningMap +mkWarningMap dflags warnings gre exps = case warnings of + NoWarnings -> return M.empty + WarnAll _ -> return M.empty + WarnSome ws -> do + let ws' = [ (n, w) | (occ, w) <- ws, elt <- lookupGlobalRdrEnv gre occ + , let n = gre_name elt, n `elem` exps ] + M.fromList . catMaybes <$> mapM parse ws' + where + parse (n, w) = (fmap $ (,) n) <$> parseWarning dflags gre w -moduleWarning :: Warnings -> Maybe (Doc id) -moduleWarning ws = +moduleWarning :: DynFlags -> GlobalRdrEnv -> Warnings -> ErrMsgM (Maybe (Doc Name)) +moduleWarning dflags gre ws = case ws of - NoWarnings -> Nothing - WarnSome _ -> Nothing - WarnAll w -> Just $! warnToDoc w + NoWarnings -> return Nothing + WarnSome _ -> return Nothing + WarnAll w -> parseWarning dflags gre w -warnToDoc :: WarningTxt -> Doc id -warnToDoc w = case w of - (DeprecatedTxt msg) -> format "Deprecated: " msg - (WarningTxt msg) -> format "Warning: " msg +parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> ErrMsgM (Maybe (Doc Name)) +parseWarning dflags gre w = do + r <- case w of + (DeprecatedTxt msg) -> format "Deprecated: " msg + (WarningTxt msg) -> format "Warning: " msg + r `deepseq` return r where - format x xs = let !str = force $ concat (x : map unpackFS xs) - in DocWarning $ DocParagraph $ DocString str + format x xs = fmap (DocWarning . DocParagraph . DocAppend (DocString x)) + <$> processDocString dflags gre (HsDocString $ concatFS xs) ------------------------------------------------------------------------------- diff --git a/src/Haddock/Parse.y b/src/Haddock/Parse.y index 0befe395..f40ff521 100644 --- a/src/Haddock/Parse.y +++ b/src/Haddock/Parse.y @@ -7,7 +7,7 @@ -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details -module Haddock.Parse where +module Haddock.Parse (parseString, parseParas) where import Haddock.Lex import Haddock.Types (Doc(..), Example(Example), Hyperlink(..)) diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index 05fc9747..9be46748 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -1,5 +1,5 @@ -{-# OPTIONS_HADDOCK hide #-} {-# LANGUAGE DeriveDataTypeable, DeriveFunctor #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Types @@ -22,6 +22,7 @@ module Haddock.Types ( import Control.Exception import Control.Arrow +import Control.DeepSeq import Data.Typeable import Data.Map (Map) import Data.Maybe @@ -316,18 +317,54 @@ instance Monoid (Doc id) where mappend = DocAppend +instance NFData a => NFData (Doc a) where + rnf doc = case doc of + DocEmpty -> () + DocAppend a b -> a `deepseq` b `deepseq` () + DocString a -> a `deepseq` () + DocParagraph a -> a `deepseq` () + DocIdentifier a -> a `deepseq` () + DocIdentifierUnchecked a -> a `deepseq` () + DocModule a -> a `deepseq` () + DocWarning a -> a `deepseq` () + DocEmphasis a -> a `deepseq` () + DocMonospaced a -> a `deepseq` () + DocUnorderedList a -> a `deepseq` () + DocOrderedList a -> a `deepseq` () + DocDefList a -> a `deepseq` () + DocCodeBlock a -> a `deepseq` () + DocHyperlink a -> a `deepseq` () + DocPic a -> a `deepseq` () + DocAName a -> a `deepseq` () + DocProperty a -> a `deepseq` () + DocExamples a -> a `deepseq` () + + +instance NFData Name +instance NFData OccName +instance NFData ModuleName + + data Hyperlink = Hyperlink { hyperlinkUrl :: String , hyperlinkLabel :: Maybe String } deriving (Eq, Show) +instance NFData Hyperlink where + rnf (Hyperlink a b) = a `deepseq` b `deepseq` () + + data Example = Example { exampleExpression :: String , exampleResult :: [String] } deriving (Eq, Show) +instance NFData Example where + rnf (Example a b) = a `deepseq` b `deepseq` () + + exampleToString :: Example -> String exampleToString (Example expression result) = ">>> " ++ expression ++ "\n" ++ unlines result diff --git a/tests/html-tests/tests/BugDeprecated.html.ref b/tests/html-tests/tests/BugDeprecated.html.ref index f632d670..913b189d 100644 --- a/tests/html-tests/tests/BugDeprecated.html.ref +++ b/tests/html-tests/tests/BugDeprecated.html.ref @@ -96,7 +96,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");} >

    Deprecated: for foo

    Deprecated: for foo +

    Deprecated: for baz

    Deprecated: for baz +

    Deprecated: for bar

    Deprecated: for bar +

    Deprecated: for one

    Deprecated: for one +

    some documentation for one, two and three @@ -155,7 +159,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");} >

    Deprecated: for three

    Deprecated: for three +

    some documentation for one, two and three @@ -172,7 +177,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugDeprecated.html");} >

    Deprecated: for two

    Deprecated: for two +

    some documentation for one, two and three diff --git a/tests/html-tests/tests/BugExportHeadings.html.ref b/tests/html-tests/tests/BugExportHeadings.html.ref index d3298b2e..457e2c50 100644 --- a/tests/html-tests/tests/BugExportHeadings.html.ref +++ b/tests/html-tests/tests/BugExportHeadings.html.ref @@ -166,7 +166,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_BugExportHeadings.html >

    Deprecated: for one

    Deprecated: for one +

    Deprecated: for two

    Deprecated: for two +

    Deprecated: for three

    Deprecated: for three +

    Deprecated: SomeClass

    Deprecated: SomeClass +

    some class @@ -106,7 +107,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedClass.html") >

    Deprecated: foo

    Deprecated: foo +

    documentation for foo @@ -126,7 +128,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedClass.html") >

    Deprecated: SomeOtherClass

    Deprecated: SomeOtherClass +

    Deprecated: bar

    Deprecated: bar +

    Deprecated: Foo

    Deprecated: Foo +

    type Foo @@ -110,7 +111,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html"); >

    Deprecated: Foo

    Deprecated: Foo +

    constructor Foo @@ -125,7 +127,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html"); >

    Deprecated: Bar

    Deprecated: Bar +

    constructor Bar @@ -145,7 +148,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedData.html"); >

    Deprecated: One

    Deprecated: One +

    Deprecated: One

    Deprecated: One +

    Deprecated: Two

    Deprecated: Two +

    :: Int
  • bar :: Int
  • Deprecated: use bar instead

    Deprecated: use bar instead +

    some documentation foo + >some documentation for foo +

    bar :: Int

    some documentation for bar

    Deprecated: use bar instead

    Deprecated: use bar instead +

    Deprecated: use bar instead

    Deprecated: use bar instead +

    Deprecated: Use Foo instead

    Deprecated: Use Foo instead +

    Documentation for

    some documentation @@ -100,7 +101,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedNewtype.html >

    constructor docu @@ -120,7 +122,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedNewtype.html >

    Date: Sun, 14 Oct 2012 13:55:09 +0200 Subject: If parsing of deprecation message fails, include it verbatim --- src/Haddock/Interface/Create.hs | 19 ++-- .../tests/DeprecationMessageParseError.hs | 12 +++ .../tests/DeprecationMessageParseError.html.ref | 101 +++++++++++++++++++++ .../mini_DeprecationMessageParseError.html.ref | 31 +++++++ 4 files changed, 154 insertions(+), 9 deletions(-) create mode 100644 tests/html-tests/tests/DeprecationMessageParseError.hs create mode 100644 tests/html-tests/tests/DeprecationMessageParseError.html.ref create mode 100644 tests/html-tests/tests/mini_DeprecationMessageParseError.html.ref (limited to 'tests') diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index fca1a00e..3eb5205c 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -41,7 +41,7 @@ import Name import Bag import RdrName import TcRnTypes -import FastString (concatFS) +import FastString (unpackFS, concatFS) -- | Use a 'TypecheckedModule' to produce an 'Interface'. @@ -179,9 +179,9 @@ mkWarningMap dflags warnings gre exps = case warnings of WarnSome ws -> do let ws' = [ (n, w) | (occ, w) <- ws, elt <- lookupGlobalRdrEnv gre occ , let n = gre_name elt, n `elem` exps ] - M.fromList . catMaybes <$> mapM parse ws' + M.fromList <$> mapM parse ws' where - parse (n, w) = (fmap $ (,) n) <$> parseWarning dflags gre w + parse (n, w) = (,) n <$> parseWarning dflags gre w moduleWarning :: DynFlags -> GlobalRdrEnv -> Warnings -> ErrMsgM (Maybe (Doc Name)) @@ -189,18 +189,19 @@ moduleWarning dflags gre ws = case ws of NoWarnings -> return Nothing WarnSome _ -> return Nothing - WarnAll w -> parseWarning dflags gre w + WarnAll w -> Just <$> parseWarning dflags gre w -parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> ErrMsgM (Maybe (Doc Name)) +parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> ErrMsgM (Doc Name) parseWarning dflags gre w = do r <- case w of - (DeprecatedTxt msg) -> format "Deprecated: " msg - (WarningTxt msg) -> format "Warning: " msg + (DeprecatedTxt msg) -> format "Deprecated: " (concatFS msg) + (WarningTxt msg) -> format "Warning: " (concatFS msg) r `deepseq` return r where - format x xs = fmap (DocWarning . DocParagraph . DocAppend (DocString x)) - <$> processDocString dflags gre (HsDocString $ concatFS xs) + format x xs = DocWarning . DocParagraph . DocAppend (DocString x) + . fromMaybe (DocString . unpackFS $ xs) + <$> processDocString dflags gre (HsDocString xs) ------------------------------------------------------------------------------- diff --git a/tests/html-tests/tests/DeprecationMessageParseError.hs b/tests/html-tests/tests/DeprecationMessageParseError.hs new file mode 100644 index 00000000..5f0b8713 --- /dev/null +++ b/tests/html-tests/tests/DeprecationMessageParseError.hs @@ -0,0 +1,12 @@ +-- | +-- What is tested here: +-- +-- * if parsing of a deprecation message fails, the message is included +-- verbatim +-- +module DeprecationMessageParseError where + +-- | some documentation for foo +foo :: Int +foo = 23 +{-# DEPRECATED foo "use @bar instead" #-} diff --git a/tests/html-tests/tests/DeprecationMessageParseError.html.ref b/tests/html-tests/tests/DeprecationMessageParseError.html.ref new file mode 100644 index 00000000..b4ea426e --- /dev/null +++ b/tests/html-tests/tests/DeprecationMessageParseError.html.ref @@ -0,0 +1,101 @@ + +DeprecationMessageParseError
    Safe HaskellNone

    DeprecationMessageParseError

    Description

    What is tested here: +

    • if parsing of a deprecation message fails, the message is included + verbatim +

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use @bar instead

    some documentation for foo +

    diff --git a/tests/html-tests/tests/mini_DeprecationMessageParseError.html.ref b/tests/html-tests/tests/mini_DeprecationMessageParseError.html.ref new file mode 100644 index 00000000..e52f487f --- /dev/null +++ b/tests/html-tests/tests/mini_DeprecationMessageParseError.html.ref @@ -0,0 +1,31 @@ + +DeprecationMessageParseError

    DeprecationMessageParseError

    -- cgit v1.2.3 From ab6e43c21e9eb22a4538303c1728c4e8d2f35f24 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 14:13:24 +0200 Subject: Add description for PruneWithWarning test --- tests/html-tests/tests/DeprecationMessageParseError.hs | 4 ++-- .../tests/DeprecationMessageParseError.html.ref | 4 ++-- tests/html-tests/tests/PruneWithWarning.hs | 6 ++++++ tests/html-tests/tests/PruneWithWarning.html.ref | 17 +++++++++++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/tests/DeprecationMessageParseError.hs b/tests/html-tests/tests/DeprecationMessageParseError.hs index 5f0b8713..2f8fb492 100644 --- a/tests/html-tests/tests/DeprecationMessageParseError.hs +++ b/tests/html-tests/tests/DeprecationMessageParseError.hs @@ -1,8 +1,8 @@ -- | -- What is tested here: -- --- * if parsing of a deprecation message fails, the message is included --- verbatim +-- * If parsing of a deprecation message fails, the message is included +-- verbatim. -- module DeprecationMessageParseError where diff --git a/tests/html-tests/tests/DeprecationMessageParseError.html.ref b/tests/html-tests/tests/DeprecationMessageParseError.html.ref index b4ea426e..75f9bf54 100644 --- a/tests/html-tests/tests/DeprecationMessageParseError.html.ref +++ b/tests/html-tests/tests/DeprecationMessageParseError.html.ref @@ -50,8 +50,8 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecationMessagePars

    • if parsing of a deprecation message fails, the message is included - verbatim + > If parsing of a deprecation message fails, the message is included + verbatim.

    PruneWithWarning

    Description

    What is tested here: +

    • If a binding has a deprecation message but no documentation, it is pruned + when OPTIONS_HADDOCK prune is used. +
    Date: Sun, 14 Oct 2012 16:03:43 +0200 Subject: Properly handle deprecation messages for re-exported things (fixes #220) --- src/Haddock/Interface/Create.hs | 7 +- src/Haddock/Types.hs | 5 ++ tests/html-tests/tests/DeprecatedReExport.hs | 3 + tests/html-tests/tests/DeprecatedReExport.html.ref | 91 ++++++++++++++++++++++ .../tests/mini_DeprecatedReExport.html.ref | 31 ++++++++ 5 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 tests/html-tests/tests/DeprecatedReExport.hs create mode 100644 tests/html-tests/tests/DeprecatedReExport.html.ref create mode 100644 tests/html-tests/tests/mini_DeprecatedReExport.html.ref (limited to 'tests') diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 2ffe8de8..6c121ad4 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -92,7 +92,9 @@ createInterface tm flags modMap instIfaceMap = do warningMap <- liftErrMsg $ mkWarningMap dflags warnings gre exportedNames - exportItems <- mkExportItems modMap mdl warningMap gre exportedNames decls maps exports + let allWarnings = M.unions (warningMap : map ifaceWarningMap (M.elems modMap)) + + exportItems <- mkExportItems modMap mdl allWarnings gre exportedNames decls maps exports instances instIfaceMap dflags let !visibleNames = mkVisibleNames exportItems opts @@ -135,6 +137,7 @@ createInterface tm flags modMap instIfaceMap = do , ifaceModuleAliases = aliases , ifaceInstances = instances , ifaceHaddockCoverage = coverage + , ifaceWarningMap = warningMap } mkAliasMap :: DynFlags -> Maybe RenamedSource -> M.Map Module ModuleName @@ -170,8 +173,6 @@ lookupModuleDyn dflags Nothing mdlName = -- Warnings ------------------------------------------------------------------------------- -type WarningMap = DocMap Name - mkWarningMap :: DynFlags -> Warnings -> GlobalRdrEnv -> [Name] -> ErrMsgM WarningMap mkWarningMap dflags warnings gre exps = case warnings of NoWarnings -> return M.empty diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index 9be46748..181ea026 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -114,8 +114,13 @@ data Interface = Interface -- | The number of haddockable and haddocked items in the module, as a -- tuple. Haddockable items are the exports and the module itself. , ifaceHaddockCoverage :: !(Int, Int) + + -- | Warnings for things defined in this module. + , ifaceWarningMap :: !WarningMap } +type WarningMap = DocMap Name + -- | A subset of the fields of 'Interface' that we store in the interface -- files. diff --git a/tests/html-tests/tests/DeprecatedReExport.hs b/tests/html-tests/tests/DeprecatedReExport.hs new file mode 100644 index 00000000..10a8c6a2 --- /dev/null +++ b/tests/html-tests/tests/DeprecatedReExport.hs @@ -0,0 +1,3 @@ +module DeprecatedReExport (foo) where + +import DeprecatedFunction diff --git a/tests/html-tests/tests/DeprecatedReExport.html.ref b/tests/html-tests/tests/DeprecatedReExport.html.ref new file mode 100644 index 00000000..17988951 --- /dev/null +++ b/tests/html-tests/tests/DeprecatedReExport.html.ref @@ -0,0 +1,91 @@ + +DeprecatedReExport
    Safe HaskellNone

    DeprecatedReExport

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use bar instead +

    some documentation for foo +

    diff --git a/tests/html-tests/tests/mini_DeprecatedReExport.html.ref b/tests/html-tests/tests/mini_DeprecatedReExport.html.ref new file mode 100644 index 00000000..de5dcf95 --- /dev/null +++ b/tests/html-tests/tests/mini_DeprecatedReExport.html.ref @@ -0,0 +1,31 @@ + +DeprecatedReExport

    DeprecatedReExport

    -- cgit v1.2.3 From b892eed5336993c3196fb411f6e91dbe90e152c7 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 23:20:26 +0200 Subject: unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. --- tests/unit-tests/Haddock/ParseSpec.hs | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'tests') diff --git a/tests/unit-tests/Haddock/ParseSpec.hs b/tests/unit-tests/Haddock/ParseSpec.hs index 0c959982..f7b32fb8 100644 --- a/tests/unit-tests/Haddock/ParseSpec.hs +++ b/tests/unit-tests/Haddock/ParseSpec.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} +{-# LANGUAGE OverloadedStrings, StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Haddock.ParseSpec (main, spec) where @@ -8,8 +8,9 @@ import DynFlags (DynFlags, defaultDynFlags) import Haddock.Lex (tokenise) import Haddock.Parse (parseParas) import Haddock.Types -import Outputable +import Outputable (Outputable, showSDoc, ppr) import Data.Monoid +import Data.String dynFlags :: DynFlags dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") @@ -20,6 +21,9 @@ instance Outputable a => Show a where deriving instance Show a => Show (Doc a) deriving instance Eq a =>Eq (Doc a) +instance IsString (Doc RdrName) where + fromString = DocString + parse :: String -> Maybe (Doc RdrName) parse s = parseParas $ tokenise dynFlags s (0,0) @@ -29,27 +33,25 @@ main = hspec spec spec :: Spec spec = do describe "parseParas" $ do - it "parses a paragraph" $ do - parse "foobar" `shouldBe` (Just . DocParagraph . DocString) "foobar\n" + parse "foobar" `shouldBe` Just (DocParagraph "foobar\n") context "when parsing an example" $ do - it "requires an example to be separated from a previous paragrap by an empty line" $ do parse "foobar\n\n>>> fib 10\n55" `shouldBe` - (Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]])) + Just (DocParagraph "foobar\n" <> DocExamples [Example "fib 10" ["55"]]) -- parse error parse "foobar\n>>> fib 10\n55" `shouldBe` Nothing it "parses a result line that only contains as an emptly line" $ do parse ">>> putFooBar\nfoo\n\nbar" `shouldBe` - (Just $ DocExamples $ [Example "putFooBar" ["foo","","bar"]]) + Just (DocExamples [Example "putFooBar" ["foo","","bar"]]) context "when parsing a code block" $ do it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do parse "foobar\n\n> some code" `shouldBe` - Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n"))) + Just (DocParagraph "foobar\n" <> DocCodeBlock " some code\n") -- parse error parse "foobar\n> some code" `shouldBe` Nothing @@ -58,22 +60,22 @@ spec = do context "when parsing a URL" $ do it "parses a URL" $ do parse "" `shouldBe` - (Just . DocParagraph $ hyperlink "http://example.com/" Nothing `mappend` DocString "\n") + Just (DocParagraph $ hyperlink "http://example.com/" Nothing <> "\n") it "accepts an optional label" $ do parse "" `shouldBe` - (Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n") + Just (DocParagraph $ hyperlink "http://example.com/" (Just "some link") <> "\n") context "when parsing properties" $ do it "can parse a single property" $ do - parse "prop> 23 == 23" `shouldBe` (Just $ DocProperty "23 == 23") + parse "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") it "can parse a multiple subsequent properties" $ do - let input = unlines [ - "prop> 23 == 23" - , "prop> 42 == 42" - ] - parse input `shouldBe` (Just $ DocProperty "23 == 23" `DocAppend` DocProperty "42 == 42") + parse $ unlines [ + "prop> 23 == 23" + , "prop> 42 == 42" + ] + `shouldBe` Just (DocProperty "23 == 23" <> DocProperty "42 == 42") where hyperlink :: String -> Maybe String -> Doc RdrName hyperlink url = DocHyperlink . Hyperlink url -- cgit v1.2.3 From a9de80ea72421837848cbdca01745e2a5b9920a7 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Sun, 14 Oct 2012 23:37:21 +0200 Subject: unit-tests: Minor refactoring Rename parse to parseParas. --- tests/unit-tests/Haddock/ParseSpec.hs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'tests') diff --git a/tests/unit-tests/Haddock/ParseSpec.hs b/tests/unit-tests/Haddock/ParseSpec.hs index f7b32fb8..adaca3f7 100644 --- a/tests/unit-tests/Haddock/ParseSpec.hs +++ b/tests/unit-tests/Haddock/ParseSpec.hs @@ -6,7 +6,7 @@ import Test.Hspec import RdrName (RdrName) import DynFlags (DynFlags, defaultDynFlags) import Haddock.Lex (tokenise) -import Haddock.Parse (parseParas) +import qualified Haddock.Parse as Parse import Haddock.Types import Outputable (Outputable, showSDoc, ppr) import Data.Monoid @@ -24,8 +24,8 @@ deriving instance Eq a =>Eq (Doc a) instance IsString (Doc RdrName) where fromString = DocString -parse :: String -> Maybe (Doc RdrName) -parse s = parseParas $ tokenise dynFlags s (0,0) +parseParas :: String -> Maybe (Doc RdrName) +parseParas s = Parse.parseParas $ tokenise dynFlags s (0,0) main :: IO () main = hspec spec @@ -34,44 +34,44 @@ spec :: Spec spec = do describe "parseParas" $ do it "parses a paragraph" $ do - parse "foobar" `shouldBe` Just (DocParagraph "foobar\n") + parseParas "foobar" `shouldBe` Just (DocParagraph "foobar\n") context "when parsing an example" $ do it "requires an example to be separated from a previous paragrap by an empty line" $ do - parse "foobar\n\n>>> fib 10\n55" `shouldBe` + parseParas "foobar\n\n>>> fib 10\n55" `shouldBe` Just (DocParagraph "foobar\n" <> DocExamples [Example "fib 10" ["55"]]) -- parse error - parse "foobar\n>>> fib 10\n55" `shouldBe` Nothing + parseParas "foobar\n>>> fib 10\n55" `shouldBe` Nothing it "parses a result line that only contains as an emptly line" $ do - parse ">>> putFooBar\nfoo\n\nbar" `shouldBe` + parseParas ">>> putFooBar\nfoo\n\nbar" `shouldBe` Just (DocExamples [Example "putFooBar" ["foo","","bar"]]) context "when parsing a code block" $ do it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do - parse "foobar\n\n> some code" `shouldBe` + parseParas "foobar\n\n> some code" `shouldBe` Just (DocParagraph "foobar\n" <> DocCodeBlock " some code\n") -- parse error - parse "foobar\n> some code" `shouldBe` Nothing + parseParas "foobar\n> some code" `shouldBe` Nothing context "when parsing a URL" $ do it "parses a URL" $ do - parse "" `shouldBe` + parseParas "" `shouldBe` Just (DocParagraph $ hyperlink "http://example.com/" Nothing <> "\n") it "accepts an optional label" $ do - parse "" `shouldBe` + parseParas "" `shouldBe` Just (DocParagraph $ hyperlink "http://example.com/" (Just "some link") <> "\n") context "when parsing properties" $ do it "can parse a single property" $ do - parse "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") + parseParas "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") it "can parse a multiple subsequent properties" $ do - parse $ unlines [ + parseParas $ unlines [ "prop> 23 == 23" , "prop> 42 == 42" ] -- cgit v1.2.3 From 6b294a1b19bbda6124b0dc7e7929c58225c35733 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 00:36:42 +0200 Subject: Fix typo --- tests/unit-tests/Haddock/ParseSpec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unit-tests/Haddock/ParseSpec.hs b/tests/unit-tests/Haddock/ParseSpec.hs index adaca3f7..d692cb0c 100644 --- a/tests/unit-tests/Haddock/ParseSpec.hs +++ b/tests/unit-tests/Haddock/ParseSpec.hs @@ -70,7 +70,7 @@ spec = do it "can parse a single property" $ do parseParas "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") - it "can parse a multiple subsequent properties" $ do + it "can parse multiple subsequent properties" $ do parseParas $ unlines [ "prop> 23 == 23" , "prop> 42 == 42" -- cgit v1.2.3 From 89b52831f24e6ad94b2d763e704119829e1ddc6c Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 10:30:07 +0200 Subject: Add description for DeprecatedReExport test --- tests/html-tests/tests/DeprecatedReExport.hs | 15 ++++++- tests/html-tests/tests/DeprecatedReExport.html.ref | 46 +++++++++++++++++++++- .../tests/mini_DeprecatedReExport.html.ref | 8 +++- 3 files changed, 65 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/html-tests/tests/DeprecatedReExport.hs b/tests/html-tests/tests/DeprecatedReExport.hs index 10a8c6a2..f851e2ff 100644 --- a/tests/html-tests/tests/DeprecatedReExport.hs +++ b/tests/html-tests/tests/DeprecatedReExport.hs @@ -1,3 +1,16 @@ -module DeprecatedReExport (foo) where +-- | +-- What is tested here: +-- +-- * Deprecation messages are shown for re-exported items. +-- +module DeprecatedReExport ( +-- * Re-exported from an other module + foo +-- * Re-exported from an other package +-- | Not yet working, see +-- , isEmptyChan +, +) where import DeprecatedFunction +import Control.Concurrent.Chan diff --git a/tests/html-tests/tests/DeprecatedReExport.html.ref b/tests/html-tests/tests/DeprecatedReExport.html.ref index 17988951..611c181d 100644 --- a/tests/html-tests/tests/DeprecatedReExport.html.ref +++ b/tests/html-tests/tests/DeprecatedReExport.html.ref @@ -41,6 +41,36 @@ window.onload = function () {pageLoad();setSynopsis("mini_DeprecatedReExport.htm >

    DeprecatedReExport

    Description

    What is tested here: +

    • Deprecation messages are shown for re-exported items. +

    Synopsis

    Documentation

    Re-exported from an other module +

    Re-exported from an other package +

    Re-exported from an other module +

    Re-exported from an other package +

    Date: Mon, 15 Oct 2012 11:38:42 +0200 Subject: Move resources to /resources directory --- ghc.mk | 8 +- haddock.cabal | 26 +- html/Classic.theme/haskell_icon.gif | Bin 911 -> 0 bytes html/Classic.theme/minus.gif | Bin 56 -> 0 bytes html/Classic.theme/plus.gif | Bin 59 -> 0 bytes html/Classic.theme/xhaddock.css | 493 ----------------------- html/Ocean.std-theme/hslogo-16.png | Bin 1684 -> 0 bytes html/Ocean.std-theme/minus.gif | Bin 56 -> 0 bytes html/Ocean.std-theme/ocean.css | 546 -------------------------- html/Ocean.std-theme/plus.gif | Bin 59 -> 0 bytes html/Ocean.std-theme/synopsis.png | Bin 11327 -> 0 bytes html/frames.html | 30 -- html/haddock-util.js | 344 ---------------- latex/haddock.sty | 57 --- resources/html/Classic.theme/haskell_icon.gif | Bin 0 -> 911 bytes resources/html/Classic.theme/minus.gif | Bin 0 -> 56 bytes resources/html/Classic.theme/plus.gif | Bin 0 -> 59 bytes resources/html/Classic.theme/xhaddock.css | 493 +++++++++++++++++++++++ resources/html/Ocean.std-theme/hslogo-16.png | Bin 0 -> 1684 bytes resources/html/Ocean.std-theme/minus.gif | Bin 0 -> 56 bytes resources/html/Ocean.std-theme/ocean.css | 546 ++++++++++++++++++++++++++ resources/html/Ocean.std-theme/plus.gif | Bin 0 -> 59 bytes resources/html/Ocean.std-theme/synopsis.png | Bin 0 -> 11327 bytes resources/html/frames.html | 30 ++ resources/html/haddock-util.js | 344 ++++++++++++++++ resources/latex/haddock.sty | 57 +++ tests/html-tests/runtests.hs | 8 +- 27 files changed, 1492 insertions(+), 1490 deletions(-) delete mode 100644 html/Classic.theme/haskell_icon.gif delete mode 100644 html/Classic.theme/minus.gif delete mode 100644 html/Classic.theme/plus.gif delete mode 100644 html/Classic.theme/xhaddock.css delete mode 100644 html/Ocean.std-theme/hslogo-16.png delete mode 100644 html/Ocean.std-theme/minus.gif delete mode 100644 html/Ocean.std-theme/ocean.css delete mode 100644 html/Ocean.std-theme/plus.gif delete mode 100644 html/Ocean.std-theme/synopsis.png delete mode 100644 html/frames.html delete mode 100644 html/haddock-util.js delete mode 100644 latex/haddock.sty create mode 100644 resources/html/Classic.theme/haskell_icon.gif create mode 100644 resources/html/Classic.theme/minus.gif create mode 100644 resources/html/Classic.theme/plus.gif create mode 100644 resources/html/Classic.theme/xhaddock.css create mode 100644 resources/html/Ocean.std-theme/hslogo-16.png create mode 100644 resources/html/Ocean.std-theme/minus.gif create mode 100644 resources/html/Ocean.std-theme/ocean.css create mode 100644 resources/html/Ocean.std-theme/plus.gif create mode 100644 resources/html/Ocean.std-theme/synopsis.png create mode 100644 resources/html/frames.html create mode 100644 resources/html/haddock-util.js create mode 100644 resources/latex/haddock.sty (limited to 'tests') diff --git a/ghc.mk b/ghc.mk index 3742565c..3af63818 100644 --- a/ghc.mk +++ b/ghc.mk @@ -13,11 +13,11 @@ $(INPLACE_BIN)/$(utils/haddock_dist_PROG): $(INPLACE_LIB)/html $(INPLACE_LIB)/la $(INPLACE_LIB)/html: $(call removeTrees,$@) - "$(CP)" -R utils/haddock/html $@ + "$(CP)" -R utils/haddock/resources/html $@ $(INPLACE_LIB)/latex: $(call removeTrees,$@) - "$(CP)" -R utils/haddock/latex $@ + "$(CP)" -R utils/haddock/resources/latex $@ endif @@ -41,12 +41,12 @@ install_utils/haddock_data: $(foreach i,$(sort $(dir $(utils/haddock_dist_DATA_FILES))), \ $(call make-command,$(call INSTALL_DIR,"$(DESTDIR)$(ghclibdir)/$i"))) $(foreach i,$(utils/haddock_dist_DATA_FILES), \ - $(call make-command,$(call INSTALL_DATA,$(INSTALL_OPTS),utils/haddock/$i,"$(DESTDIR)$(ghclibdir)/$(dir $i)"))) + $(call make-command,$(call INSTALL_DATA,$(INSTALL_OPTS),utils/haddock/resources/$i,"$(DESTDIR)$(ghclibdir)/$(dir $i)"))) .PHONY: install_utils/haddock_link install_utils/haddock_link: $(call removeFiles,"$(DESTDIR)$(bindir)/haddock") $(LN_S) $(utils/haddock_dist_INSTALL_SHELL_WRAPPER_NAME) "$(DESTDIR)$(bindir)/haddock" -BINDIST_EXTRAS += $(addprefix utils/haddock/,$(utils/haddock_dist_DATA_FILES)) +BINDIST_EXTRAS += $(addprefix utils/haddock/resources/,$(utils/haddock_dist_DATA_FILES)) diff --git a/haddock.cabal b/haddock.cabal index 88c18cd3..846d7c6a 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -33,19 +33,19 @@ extra-source-files: -- the test-suite stanzas don't get picked up by `cabal sdist`. tests/html-tests/runtests.hs -data-files: - html/frames.html - html/haddock-util.js - html/Classic.theme/haskell_icon.gif - html/Classic.theme/minus.gif - html/Classic.theme/plus.gif - html/Classic.theme/xhaddock.css - html/Ocean.std-theme/hslogo-16.png - html/Ocean.std-theme/minus.gif - html/Ocean.std-theme/ocean.css - html/Ocean.std-theme/plus.gif - html/Ocean.std-theme/synopsis.png - latex/haddock.sty +data-dir: resources +data-files: html/frames.html + html/haddock-util.js + html/Classic.theme/haskell_icon.gif + html/Classic.theme/minus.gif + html/Classic.theme/plus.gif + html/Classic.theme/xhaddock.css + html/Ocean.std-theme/hslogo-16.png + html/Ocean.std-theme/minus.gif + html/Ocean.std-theme/ocean.css + html/Ocean.std-theme/plus.gif + html/Ocean.std-theme/synopsis.png + latex/haddock.sty flag in-ghc-tree description: Are we in a GHC tree? diff --git a/html/Classic.theme/haskell_icon.gif b/html/Classic.theme/haskell_icon.gif deleted file mode 100644 index 10589f91..00000000 Binary files a/html/Classic.theme/haskell_icon.gif and /dev/null differ diff --git a/html/Classic.theme/minus.gif b/html/Classic.theme/minus.gif deleted file mode 100644 index 1deac2fe..00000000 Binary files a/html/Classic.theme/minus.gif and /dev/null differ diff --git a/html/Classic.theme/plus.gif b/html/Classic.theme/plus.gif deleted file mode 100644 index 2d15c141..00000000 Binary files a/html/Classic.theme/plus.gif and /dev/null differ diff --git a/html/Classic.theme/xhaddock.css b/html/Classic.theme/xhaddock.css deleted file mode 100644 index 40ea0d06..00000000 --- a/html/Classic.theme/xhaddock.css +++ /dev/null @@ -1,493 +0,0 @@ -* { - margin: 0; - padding: 0; -} - -body { - background-color: #ffffff; - color: #000000; - font-size: 100%; - font-family: sans-serif; - padding: 8px; -} - -a:link { color: #0000e0; text-decoration: none } -a:visited { color: #0000a0; text-decoration: none } -a:hover { background-color: #e0e0ff; text-decoration: none } - -/* font is a little too small in MSIE */ -tt { font-size: 100%; } -pre { font-size: 100%; } -.keyword { text-decoration: underline; } -.caption { - font-weight: bold; - margin: 0; - padding: 0; -} - -h1 { - padding-top: 15px; - font-weight: bold; - font-size: 150%; -} - -h2 { - padding-top: 10px; - font-weight: bold; - font-size: 130% - } - -h3 { - padding-top: 5px; - font-weight: bold; - font-size: 110% - } - -h4, h5 { - font-weight: bold; - font-size: 100% - } - -h1, h2, h3, h4, h5 { - margin-top: 0.5em; - margin-bottom: 0.5em; -} - -p { - padding-top: 2px; - padding-left: 10px; -} - -ul, ol, dl { - padding-top: 2px; - padding-left: 10px; - margin-left: 2.5em; -} - -pre { - padding-top: 2px; - padding-left: 20px; -} - -* + p, * + pre { - margin-top: 1em; -} -.caption + p, .src + p { - margin-top: 0; -} - -.def { - font-weight: bold; -} - -ul.links { - list-style: none; - text-align: left; - float: right; - display: inline-table; - padding: 0; -} - -ul.links li { - display: inline; - border-left-width: 1px; - border-left-color: #ffffff; - border-left-style: solid; - white-space: nowrap; - padding: 1px 5px; -} - -.hide { display: none; } -.show { } -.collapser { - background: url(minus.gif) no-repeat 0 0.3em; -} -.expander { - background: url(plus.gif) no-repeat 0 0.3em; -} -.collapser, .expander { - padding-left: 14px; - cursor: pointer; -} - -#package-header { - color: #ffffff; - padding: 5px 5px 5px 31px; - margin: 0 0 1px; - background: #000099 url(haskell_icon.gif) no-repeat 5px 6px; - position: relative; -} - -#package-header .caption { - font-weight: normal; - font-style: normal; -} -#package-header a:link { color: #ffffff } -#package-header a:visited { color: #ffff00 } -#package-header a:hover { background-color: #6060ff; } -#package-header ul.links li:hover { background-color: #6060ff; } - -div#style-menu-holder { - position: relative; - z-index: 2; - display: inline; -} - -#style-menu { - position: absolute; - z-index: 1; - overflow: visible; - background-color: #000099; - margin: 0; - width: 6em; - text-align: center; - right: 0; - padding: 2px 2px 1px; -} - -#style-menu li { - display: list-item; - border-style: none; - margin: 0; - padding: 3px; - color: #000; - list-style-type: none; - border-top: 1px solid #ffffff; -} - -#module-header { - overflow: hidden; /* makes sure info float is properly contained */ - display: inline-block; /* triggers hasLayout in IE*/ -} - -#module-header { - display: block; /* back to block */ - background-color: #0077dd; - padding: 5px; -} - -#module-header .caption { - font-size: 200%; - padding: .35em 0; - font-weight: normal; - font-style: normal; -} - -table.info { - color: #ffffff; - display: block; - float: right; - max-width: 50%; -} - -.info th, .info td { - text-align: left; - padding: 0 10px 0 0; -} - - -#table-of-contents { - margin-top: 1em; - margin-bottom: 2em; -} - -#table-of-contents ul { - margin-top: 1em; - margin-bottom: 1em; - margin-left: 0; - list-style-type: none; - padding: 0; -} - -#table-of-contents ul ul { - margin-left: 2.5em; -} - -#description .caption, -#synopsis .caption, -#module-list .caption, -#index .caption { - padding-top: 15px; - font-weight: bold; - font-size: 150% -} - -#synopsis { - margin-bottom: 2em; -} - -#synopsis .expander, -#synopsis .collapser { - background: none; - padding-left: inherit; -} - -#synopsis .hide { - display: inherit; -} - -#synopsis ul { - margin: 0; - padding-top: 0; - padding-left: 20px; - list-style-type: none; -} - -#synopsis li { - margin-top: 8px; - margin-bottom: 8px; - padding: 3px; -} - -#synopsis li li { - padding: 0; - margin-top: 0; - margin-bottom: 0; -} - - -div.top { - margin-top: 1em; - clear: left; - margin-bottom: 1em; -} - -div.top h5 { - margin-left: 10px; -} - - -.src { - padding: 3px; - background-color: #f0f0f0; - font-family: monospace; - margin-bottom: 0; -} - - -.src a.link { - float: right; - border-left-width: 1px; - border-left-color: #000099; - border-left-style: solid; - white-space: nowrap; - font-size: small; - padding: 0 8px 2px 5px; - margin-right: -3px; - background-color: #f0f0f0; -} - -div.subs { - margin-left: 10px; - clear: both; - margin-top: 2px; -} - -.subs dl { - margin-left: 0; -} - -.subs dl dl { - padding-left: 0; - padding-top: 4px; -} - -.subs dd -{ - margin: 2px 0 9px 2em; -} - -.subs dd.empty { - display: none; -} - -.subs table { - margin-left: 10px; - border-spacing: 1px 1px; - margin-top: 4px; - margin-bottom: 4px; -} - -.subs table table { - margin-left: 0; -} - -.arguments .caption, -.fields .caption { - display: none; -} - -/* need extra .subs in the selector to make it override the rules for .subs and .subs table */ - -.subs.arguments { - margin: 0; -} - -.subs.arguments table { - border-spacing: 0; - margin-top: 0; - margin-bottom: 0; -} - -.subs.arguments td.src { - white-space: nowrap; -} - -.subs.arguments + p { - margin-top: 0; -} - -.subs.associated-types, -.subs.methods { - margin-left: 20px; -} - -.subs.associated-types .caption, -.subs.methods .caption { - margin-top: 0.5em; - margin-left: -10px; -} - -.subs.associated-types .src + .src, -.subs.methods .src + .src { - margin-top: 8px; -} - -p.arg { - margin-bottom: 0; -} -p.arg span { - background-color: #f0f0f0; - font-family: monospace; - white-space: nowrap; - float: none; -} - - -img.coll { - width : 0.75em; height: 0.75em; margin-bottom: 0; margin-right: 0.5em -} - - -td.arg { - padding: 3px; - background-color: #f0f0f0; - font-family: monospace; - margin-bottom: 0; -} - -td.rdoc p { - margin-bottom: 0; -} - - - -#footer { - background-color: #000099; - color: #ffffff; - padding: 4px - } - -#footer p { - padding: 1px; - margin: 0; -} - -#footer a:link { - color: #ffffff; - text-decoration: underline - } -#footer a:visited { - color: #ffff00 - } -#footer a:hover { - background-color: #6060ff - } - - -#module-list ul { - list-style: none; - padding-bottom: 15px; - padding-left: 2px; - margin: 0; -} - -#module-list ul ul { - padding-bottom: 0; - padding-left: 20px; -} - -#module-list li .package { - float: right; -} -#mini #module-list .caption { - display: none; -} - -#index .caption { -} - -#alphabet ul { - list-style: none; - padding: 0; - margin: 0.5em 0 0; -} - -#alphabet li { - display: inline; - margin: 0 0.2em; -} - -#index .src { - background: none; - font-family: inherit; -} - -#index td.alt { - padding-left: 2em; -} - -#index td { - padding-top: 2px; - padding-bottom: 1px; - padding-right: 1em; -} - - -#mini h1 { font-size: 130%; } -#mini h2 { font-size: 110%; } -#mini h3 { font-size: 100%; } -#mini h1, #mini h2, #mini h3 { - margin-top: 0.5em; - margin-bottom: 0.25em; - padding: 0 0; -} - -#mini h1 { border-bottom: 1px solid #ccc; } - -#mini #module-header { - margin: 0; - padding: 0; -} -#mini #module-header .caption { - font-size: 130%; - background: #0077dd; - padding: 0.25em; - height: inherit; - margin: 0; -} - -#mini #interface .top { - margin: 0; - padding: 0; -} -#mini #interface .src { - margin: 0; - padding: 0; - font-family: inherit; - background: inherit; -} - -.warning { - color: red; -} diff --git a/html/Ocean.std-theme/hslogo-16.png b/html/Ocean.std-theme/hslogo-16.png deleted file mode 100644 index 0ff8579f..00000000 Binary files a/html/Ocean.std-theme/hslogo-16.png and /dev/null differ diff --git a/html/Ocean.std-theme/minus.gif b/html/Ocean.std-theme/minus.gif deleted file mode 100644 index 1deac2fe..00000000 Binary files a/html/Ocean.std-theme/minus.gif and /dev/null differ diff --git a/html/Ocean.std-theme/ocean.css b/html/Ocean.std-theme/ocean.css deleted file mode 100644 index 42238709..00000000 --- a/html/Ocean.std-theme/ocean.css +++ /dev/null @@ -1,546 +0,0 @@ -/* @group Fundamentals */ - -* { margin: 0; padding: 0 } - -/* Is this portable? */ -html { - background-color: white; - width: 100%; - height: 100%; -} - -body { - background: white; - color: black; - text-align: left; - min-height: 100%; - position: relative; -} - -p { - margin: 0.8em 0; -} - -ul, ol { - margin: 0.8em 0 0.8em 2em; -} - -dl { - margin: 0.8em 0; -} - -dt { - font-weight: bold; -} -dd { - margin-left: 2em; -} - -a { text-decoration: none; } -a[href]:link { color: rgb(196,69,29); } -a[href]:visited { color: rgb(171,105,84); } -a[href]:hover { text-decoration:underline; } - -/* @end */ - -/* @group Fonts & Sizes */ - -/* Basic technique & IE workarounds from YUI 3 - For reasons, see: - http://yui.yahooapis.com/3.1.1/build/cssfonts/fonts.css - */ - -body { - font:13px/1.4 sans-serif; - *font-size:small; /* for IE */ - *font:x-small; /* for IE in quirks mode */ -} - -h1 { font-size: 146.5%; /* 19pt */ } -h2 { font-size: 131%; /* 17pt */ } -h3 { font-size: 116%; /* 15pt */ } -h4 { font-size: 100%; /* 13pt */ } -h5 { font-size: 100%; /* 13pt */ } - -select, input, button, textarea { - font:99% sans-serif; -} - -table { - font-size:inherit; - font:100%; -} - -pre, code, kbd, samp, tt, .src { - font-family:monospace; - *font-size:108%; - line-height: 124%; -} - -.links, .link { - font-size: 85%; /* 11pt */ -} - -#module-header .caption { - font-size: 182%; /* 24pt */ -} - -.info { - font-size: 85%; /* 11pt */ -} - -#table-of-contents, #synopsis { - /* font-size: 85%; /* 11pt */ -} - - -/* @end */ - -/* @group Common */ - -.caption, h1, h2, h3, h4, h5, h6 { - font-weight: bold; - color: rgb(78,98,114); - margin: 0.8em 0 0.4em; -} - -* + h1, * + h2, * + h3, * + h4, * + h5, * + h6 { - margin-top: 2em; -} - -h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 { - margin-top: inherit; -} - -ul.links { - list-style: none; - text-align: left; - float: right; - display: inline-table; - margin: 0 0 0 1em; -} - -ul.links li { - display: inline; - border-left: 1px solid #d5d5d5; - white-space: nowrap; - padding: 0; -} - -ul.links li a { - padding: 0.2em 0.5em; -} - -.hide { display: none; } -.show { display: inherit; } -.clear { clear: both; } - -.collapser { - background-image: url(minus.gif); - background-repeat: no-repeat; -} -.expander { - background-image: url(plus.gif); - background-repeat: no-repeat; -} -p.caption.collapser, -p.caption.expander { - background-position: 0 0.4em; -} -.collapser, .expander { - padding-left: 14px; - margin-left: -14px; - cursor: pointer; -} - -pre { - padding: 0.25em; - margin: 0.8em 0; - background: rgb(229,237,244); - overflow: auto; - border-bottom: 0.25em solid white; - /* white border adds some space below the box to compensate - for visual extra space that paragraphs have between baseline - and the bounding box */ -} - -.src { - background: #f0f0f0; - padding: 0.2em 0.5em; -} - -.keyword { font-weight: normal; } -.def { font-weight: bold; } - - -/* @end */ - -/* @group Page Structure */ - -#content { - margin: 0 auto; - padding: 0 2em 6em; -} - -#package-header { - background: rgb(41,56,69); - border-top: 5px solid rgb(78,98,114); - color: #ddd; - padding: 0.2em; - position: relative; - text-align: left; -} - -#package-header .caption { - background: url(hslogo-16.png) no-repeat 0em; - color: white; - margin: 0 2em; - font-weight: normal; - font-style: normal; - padding-left: 2em; -} - -#package-header a:link, #package-header a:visited { color: white; } -#package-header a:hover { background: rgb(78,98,114); } - -#module-header .caption { - color: rgb(78,98,114); - font-weight: bold; - border-bottom: 1px solid #ddd; -} - -table.info { - float: right; - padding: 0.5em 1em; - border: 1px solid #ddd; - color: rgb(78,98,114); - background-color: #fff; - max-width: 40%; - border-spacing: 0; - position: relative; - top: -0.5em; - margin: 0 0 0 2em; -} - -.info th { - padding: 0 1em 0 0; -} - -div#style-menu-holder { - position: relative; - z-index: 2; - display: inline; -} - -#style-menu { - position: absolute; - z-index: 1; - overflow: visible; - background: #374c5e; - margin: 0; - text-align: center; - right: 0; - padding: 0; - top: 1.25em; -} - -#style-menu li { - display: list-item; - border-style: none; - margin: 0; - padding: 0; - color: #000; - list-style-type: none; -} - -#style-menu li + li { - border-top: 1px solid #919191; -} - -#style-menu a { - width: 6em; - padding: 3px; - display: block; -} - -#footer { - background: #ddd; - border-top: 1px solid #aaa; - padding: 0.5em 0; - color: #666; - text-align: center; - position: absolute; - bottom: 0; - width: 100%; - height: 3em; -} - -/* @end */ - -/* @group Front Matter */ - -#table-of-contents { - float: right; - clear: right; - background: #faf9dc; - border: 1px solid #d8d7ad; - padding: 0.5em 1em; - max-width: 20em; - margin: 0.5em 0 1em 1em; -} - -#table-of-contents .caption { - text-align: center; - margin: 0; -} - -#table-of-contents ul { - list-style: none; - margin: 0; -} - -#table-of-contents ul ul { - margin-left: 2em; -} - -#description .caption { - display: none; -} - -#synopsis { - display: none; -} - -.no-frame #synopsis { - display: block; - position: fixed; - right: 0; - height: 80%; - top: 10%; - padding: 0; -} - -#synopsis .caption { - float: left; - width: 29px; - color: rgba(255,255,255,0); - height: 110px; - margin: 0; - font-size: 1px; - padding: 0; -} - -#synopsis p.caption.collapser { - background: url(synopsis.png) no-repeat -64px -8px; -} - -#synopsis p.caption.expander { - background: url(synopsis.png) no-repeat 0px -8px; -} - -#synopsis ul { - height: 100%; - overflow: auto; - padding: 0.5em; - margin: 0; -} - -#synopsis ul ul { - overflow: hidden; -} - -#synopsis ul, -#synopsis ul li.src { - background-color: #faf9dc; - white-space: nowrap; - list-style: none; - margin-left: 0; -} - -/* @end */ - -/* @group Main Content */ - -#interface div.top { margin: 2em 0; } -#interface h1 + div.top, -#interface h2 + div.top, -#interface h3 + div.top, -#interface h4 + div.top, -#interface h5 + div.top { - margin-top: 1em; -} -#interface p.src .link { - float: right; - color: #919191; - border-left: 1px solid #919191; - background: #f0f0f0; - padding: 0 0.5em 0.2em; - margin: 0 -0.5em 0 0.5em; -} - -#interface table { border-spacing: 2px; } -#interface td { - vertical-align: top; - padding-left: 0.5em; -} -#interface td.src { - white-space: nowrap; -} -#interface td.doc p { - margin: 0; -} -#interface td.doc p + p { - margin-top: 0.8em; -} - -.subs dl { - margin: 0; -} - -.subs dt { - float: left; - clear: left; - display: block; - margin: 1px 0; -} - -.subs dd { - float: right; - width: 90%; - display: block; - padding-left: 0.5em; - margin-bottom: 0.5em; -} - -.subs dd.empty { - display: none; -} - -.subs dd p { - margin: 0; -} - -.top p.src { - border-top: 1px solid #ccc; -} - -.subs, .doc { - /* use this selector for one level of indent */ - padding-left: 2em; -} - -.warning { - color: red; -} - -.arguments { - margin-top: -0.4em; -} -.arguments .caption { - display: none; -} - -.fields { padding-left: 1em; } - -.fields .caption { display: none; } - -.fields p { margin: 0 0; } - -/* this seems bulky to me -.methods, .constructors { - background: #f8f8f8; - border: 1px solid #eee; -} -*/ - -/* @end */ - -/* @group Auxillary Pages */ - -#mini { - margin: 0 auto; - padding: 0 1em 1em; -} - -#mini > * { - font-size: 93%; /* 12pt */ -} - -#mini #module-list .caption, -#mini #module-header .caption { - font-size: 125%; /* 15pt */ -} - -#mini #interface h1, -#mini #interface h2, -#mini #interface h3, -#mini #interface h4 { - font-size: 109%; /* 13pt */ - margin: 1em 0 0; -} - -#mini #interface .top, -#mini #interface .src { - margin: 0; -} - -#mini #module-list ul { - list-style: none; - margin: 0; -} - -#alphabet ul { - list-style: none; - padding: 0; - margin: 0.5em 0 0; - text-align: center; -} - -#alphabet li { - display: inline; - margin: 0 0.25em; -} - -#alphabet a { - font-weight: bold; -} - -#index .caption, -#module-list .caption { font-size: 131%; /* 17pt */ } - -#index table { - margin-left: 2em; -} - -#index .src { - font-weight: bold; -} -#index .alt { - font-size: 77%; /* 10pt */ - font-style: italic; - padding-left: 2em; -} - -#index td + td { - padding-left: 1em; -} - -#module-list ul { - list-style: none; - margin: 0 0 0 2em; -} - -#module-list li { - clear: right; -} - -#module-list span.collapser, -#module-list span.expander { - background-position: 0 0.3em; -} - -#module-list .package { - float: right; -} - -/* @end */ diff --git a/html/Ocean.std-theme/plus.gif b/html/Ocean.std-theme/plus.gif deleted file mode 100644 index 2d15c141..00000000 Binary files a/html/Ocean.std-theme/plus.gif and /dev/null differ diff --git a/html/Ocean.std-theme/synopsis.png b/html/Ocean.std-theme/synopsis.png deleted file mode 100644 index 85fb86ec..00000000 Binary files a/html/Ocean.std-theme/synopsis.png and /dev/null differ diff --git a/html/frames.html b/html/frames.html deleted file mode 100644 index 1b4e38d4..00000000 --- a/html/frames.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/html/haddock-util.js b/html/haddock-util.js deleted file mode 100644 index 9a6fccf7..00000000 --- a/html/haddock-util.js +++ /dev/null @@ -1,344 +0,0 @@ -// Haddock JavaScript utilities - -var rspace = /\s\s+/g, - rtrim = /^\s+|\s+$/g; - -function spaced(s) { return (" " + s + " ").replace(rspace, " "); } -function trim(s) { return s.replace(rtrim, ""); } - -function hasClass(elem, value) { - var className = spaced(elem.className || ""); - return className.indexOf( " " + value + " " ) >= 0; -} - -function addClass(elem, value) { - var className = spaced(elem.className || ""); - if ( className.indexOf( " " + value + " " ) < 0 ) { - elem.className = trim(className + " " + value); - } -} - -function removeClass(elem, value) { - var className = spaced(elem.className || ""); - className = className.replace(" " + value + " ", " "); - elem.className = trim(className); -} - -function toggleClass(elem, valueOn, valueOff, bool) { - if (bool == null) { bool = ! hasClass(elem, valueOn); } - if (bool) { - removeClass(elem, valueOff); - addClass(elem, valueOn); - } - else { - removeClass(elem, valueOn); - addClass(elem, valueOff); - } - return bool; -} - - -function makeClassToggle(valueOn, valueOff) -{ - return function(elem, bool) { - return toggleClass(elem, valueOn, valueOff, bool); - } -} - -toggleShow = makeClassToggle("show", "hide"); -toggleCollapser = makeClassToggle("collapser", "expander"); - -function toggleSection(id) -{ - var b = toggleShow(document.getElementById("section." + id)); - toggleCollapser(document.getElementById("control." + id), b); - rememberCollapsed(id, b); - return b; -} - -var collapsed = {}; -function rememberCollapsed(id, b) -{ - if(b) - delete collapsed[id] - else - collapsed[id] = null; - - var sections = []; - for(var i in collapsed) - { - if(collapsed.hasOwnProperty(i)) - sections.push(i); - } - // cookie specific to this page; don't use setCookie which sets path=/ - document.cookie = "collapsed=" + escape(sections.join('+')); -} - -function restoreCollapsed() -{ - var cookie = getCookie("collapsed"); - if(!cookie) - return; - - var ids = cookie.split('+'); - for(var i in ids) - { - if(document.getElementById("section." + ids[i])) - toggleSection(ids[i]); - } -} - -function setCookie(name, value) { - document.cookie = name + "=" + escape(value) + ";path=/;"; -} - -function clearCookie(name) { - document.cookie = name + "=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT;"; -} - -function getCookie(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(';'); - for(var i=0;i < ca.length;i++) { - var c = ca[i]; - while (c.charAt(0)==' ') c = c.substring(1,c.length); - if (c.indexOf(nameEQ) == 0) { - return unescape(c.substring(nameEQ.length,c.length)); - } - } - return null; -} - - - -var max_results = 75; // 50 is not enough to search for map in the base libraries -var shown_range = null; -var last_search = null; - -function quick_search() -{ - perform_search(false); -} - -function full_search() -{ - perform_search(true); -} - - -function perform_search(full) -{ - var text = document.getElementById("searchbox").value.toLowerCase(); - if (text == last_search && !full) return; - last_search = text; - - var table = document.getElementById("indexlist"); - var status = document.getElementById("searchmsg"); - var children = table.firstChild.childNodes; - - // first figure out the first node with the prefix - var first = bisect(-1); - var last = (first == -1 ? -1 : bisect(1)); - - if (first == -1) - { - table.className = ""; - status.innerHTML = "No results found, displaying all"; - } - else if (first == 0 && last == children.length - 1) - { - table.className = ""; - status.innerHTML = ""; - } - else if (last - first >= max_results && !full) - { - table.className = ""; - status.innerHTML = "More than " + max_results + ", press Search to display"; - } - else - { - // decide what you need to clear/show - if (shown_range) - setclass(shown_range[0], shown_range[1], "indexrow"); - setclass(first, last, "indexshow"); - shown_range = [first, last]; - table.className = "indexsearch"; - status.innerHTML = ""; - } - - - function setclass(first, last, status) - { - for (var i = first; i <= last; i++) - { - children[i].className = status; - } - } - - - // do a binary search, treating 0 as ... - // return either -1 (no 0's found) or location of most far match - function bisect(dir) - { - var first = 0, finish = children.length - 1; - var mid, success = false; - - while (finish - first > 3) - { - mid = Math.floor((finish + first) / 2); - - var i = checkitem(mid); - if (i == 0) i = dir; - if (i == -1) - finish = mid; - else - first = mid; - } - var a = (dir == 1 ? first : finish); - var b = (dir == 1 ? finish : first); - for (var i = b; i != a - dir; i -= dir) - { - if (checkitem(i) == 0) return i; - } - return -1; - } - - - // from an index, decide what the result is - // 0 = match, -1 is lower, 1 is higher - function checkitem(i) - { - var s = getitem(i).toLowerCase().substr(0, text.length); - if (s == text) return 0; - else return (s > text ? -1 : 1); - } - - - // from an index, get its string - // this abstracts over alternates - function getitem(i) - { - for ( ; i >= 0; i--) - { - var s = children[i].firstChild.firstChild.data; - if (s.indexOf(' ') == -1) - return s; - } - return ""; // should never be reached - } -} - -function setSynopsis(filename) { - if (parent.window.synopsis) { - if (parent.window.synopsis.location.replace) { - // In Firefox this avoids adding the change to the history. - parent.window.synopsis.location.replace(filename); - } else { - parent.window.synopsis.location = filename; - } - } -} - -function addMenuItem(html) { - var menu = document.getElementById("page-menu"); - if (menu) { - var btn = menu.firstChild.cloneNode(false); - btn.innerHTML = html; - menu.appendChild(btn); - } -} - -function adjustForFrames() { - var bodyCls; - - if (parent.location.href == window.location.href) { - // not in frames, so add Frames button - addMenuItem("Frames"); - bodyCls = "no-frame"; - } - else { - bodyCls = "in-frame"; - } - addClass(document.body, bodyCls); -} - -function reframe() { - setCookie("haddock-reframe", document.URL); - window.location = "frames.html"; -} - -function postReframe() { - var s = getCookie("haddock-reframe"); - if (s) { - parent.window.main.location = s; - clearCookie("haddock-reframe"); - } -} - -function styles() { - var i, a, es = document.getElementsByTagName("link"), rs = []; - for (i = 0; a = es[i]; i++) { - if(a.rel.indexOf("style") != -1 && a.title) { - rs.push(a); - } - } - return rs; -} - -function addStyleMenu() { - var as = styles(); - var i, a, btns = ""; - for(i=0; a = as[i]; i++) { - btns += "
  • " - + a.title + "
  • " - } - if (as.length > 1) { - var h = "
    " - + "Style ▾" - + "
      " + btns + "
    " - + "
    "; - addMenuItem(h); - } -} - -function setActiveStyleSheet(title) { - var as = styles(); - var i, a, found; - for(i=0; a = as[i]; i++) { - a.disabled = true; - // need to do this always, some browsers are edge triggered - if(a.title == title) { - found = a; - } - } - if (found) { - found.disabled = false; - setCookie("haddock-style", title); - } - else { - as[0].disabled = false; - clearCookie("haddock-style"); - } - styleMenu(false); -} - -function resetStyle() { - var s = getCookie("haddock-style"); - if (s) setActiveStyleSheet(s); -} - - -function styleMenu(show) { - var m = document.getElementById('style-menu'); - if (m) toggleShow(m, show); -} - - -function pageLoad() { - addStyleMenu(); - adjustForFrames(); - resetStyle(); - restoreCollapsed(); -} - diff --git a/latex/haddock.sty b/latex/haddock.sty deleted file mode 100644 index 6e031a98..00000000 --- a/latex/haddock.sty +++ /dev/null @@ -1,57 +0,0 @@ -% Default Haddock style definitions. To use your own style, invoke -% Haddock with the option --latex-style=mystyle. - -\usepackage{tabulary} % see below - -% make hyperlinks in the PDF, and add an expandabale index -\usepackage[pdftex,bookmarks=true]{hyperref} - -\newenvironment{haddocktitle} - {\begin{center}\bgroup\large\bfseries} - {\egroup\end{center}} -\newenvironment{haddockprologue}{\vspace{1in}}{} - -\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}} - -\newcommand{\haddockbeginheader}{\hrulefill} -\newcommand{\haddockendheader}{\noindent\hrulefill} - -% a little gap before the ``Methods'' header -\newcommand{\haddockpremethods}{\vspace{2ex}} - -% inserted before \\begin{verbatim} -\newcommand{\haddockverb}{\small} - -% an identifier: add an index entry -\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}} - -% The tabulary environment lets us have a column that takes up ``the -% rest of the space''. Unfortunately it doesn't allow -% the \end{tabulary} to be in the expansion of a macro, it must appear -% literally in the document text, so Haddock inserts -% the \end{tabulary} itself. -\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} -\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} - -\newcommand{\haddocktt}[1]{{\small \texttt{#1}}} -\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}} - -\makeatletter -\newenvironment{haddockdesc} - {\list{}{\labelwidth\z@ \itemindent-\leftmargin - \let\makelabel\haddocklabel}} - {\endlist} -\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}} -\makeatother - -% after a declaration, start a new line for the documentation. -% Otherwise, the documentation starts right after the declaration, -% because we're using the list environment and the declaration is the -% ``label''. I tried making this newline part of the label, but -% couldn't get that to work reliably (the space seemed to stretch -% sometimes). -\newcommand{\haddockbegindoc}{\hfill\\[1ex]} - -% spacing between paragraphs and no \parindent looks better -\parskip=10pt plus2pt minus2pt -\setlength{\parindent}{0cm} diff --git a/resources/html/Classic.theme/haskell_icon.gif b/resources/html/Classic.theme/haskell_icon.gif new file mode 100644 index 00000000..10589f91 Binary files /dev/null and b/resources/html/Classic.theme/haskell_icon.gif differ diff --git a/resources/html/Classic.theme/minus.gif b/resources/html/Classic.theme/minus.gif new file mode 100644 index 00000000..1deac2fe Binary files /dev/null and b/resources/html/Classic.theme/minus.gif differ diff --git a/resources/html/Classic.theme/plus.gif b/resources/html/Classic.theme/plus.gif new file mode 100644 index 00000000..2d15c141 Binary files /dev/null and b/resources/html/Classic.theme/plus.gif differ diff --git a/resources/html/Classic.theme/xhaddock.css b/resources/html/Classic.theme/xhaddock.css new file mode 100644 index 00000000..40ea0d06 --- /dev/null +++ b/resources/html/Classic.theme/xhaddock.css @@ -0,0 +1,493 @@ +* { + margin: 0; + padding: 0; +} + +body { + background-color: #ffffff; + color: #000000; + font-size: 100%; + font-family: sans-serif; + padding: 8px; +} + +a:link { color: #0000e0; text-decoration: none } +a:visited { color: #0000a0; text-decoration: none } +a:hover { background-color: #e0e0ff; text-decoration: none } + +/* font is a little too small in MSIE */ +tt { font-size: 100%; } +pre { font-size: 100%; } +.keyword { text-decoration: underline; } +.caption { + font-weight: bold; + margin: 0; + padding: 0; +} + +h1 { + padding-top: 15px; + font-weight: bold; + font-size: 150%; +} + +h2 { + padding-top: 10px; + font-weight: bold; + font-size: 130% + } + +h3 { + padding-top: 5px; + font-weight: bold; + font-size: 110% + } + +h4, h5 { + font-weight: bold; + font-size: 100% + } + +h1, h2, h3, h4, h5 { + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +p { + padding-top: 2px; + padding-left: 10px; +} + +ul, ol, dl { + padding-top: 2px; + padding-left: 10px; + margin-left: 2.5em; +} + +pre { + padding-top: 2px; + padding-left: 20px; +} + +* + p, * + pre { + margin-top: 1em; +} +.caption + p, .src + p { + margin-top: 0; +} + +.def { + font-weight: bold; +} + +ul.links { + list-style: none; + text-align: left; + float: right; + display: inline-table; + padding: 0; +} + +ul.links li { + display: inline; + border-left-width: 1px; + border-left-color: #ffffff; + border-left-style: solid; + white-space: nowrap; + padding: 1px 5px; +} + +.hide { display: none; } +.show { } +.collapser { + background: url(minus.gif) no-repeat 0 0.3em; +} +.expander { + background: url(plus.gif) no-repeat 0 0.3em; +} +.collapser, .expander { + padding-left: 14px; + cursor: pointer; +} + +#package-header { + color: #ffffff; + padding: 5px 5px 5px 31px; + margin: 0 0 1px; + background: #000099 url(haskell_icon.gif) no-repeat 5px 6px; + position: relative; +} + +#package-header .caption { + font-weight: normal; + font-style: normal; +} +#package-header a:link { color: #ffffff } +#package-header a:visited { color: #ffff00 } +#package-header a:hover { background-color: #6060ff; } +#package-header ul.links li:hover { background-color: #6060ff; } + +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background-color: #000099; + margin: 0; + width: 6em; + text-align: center; + right: 0; + padding: 2px 2px 1px; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 3px; + color: #000; + list-style-type: none; + border-top: 1px solid #ffffff; +} + +#module-header { + overflow: hidden; /* makes sure info float is properly contained */ + display: inline-block; /* triggers hasLayout in IE*/ +} + +#module-header { + display: block; /* back to block */ + background-color: #0077dd; + padding: 5px; +} + +#module-header .caption { + font-size: 200%; + padding: .35em 0; + font-weight: normal; + font-style: normal; +} + +table.info { + color: #ffffff; + display: block; + float: right; + max-width: 50%; +} + +.info th, .info td { + text-align: left; + padding: 0 10px 0 0; +} + + +#table-of-contents { + margin-top: 1em; + margin-bottom: 2em; +} + +#table-of-contents ul { + margin-top: 1em; + margin-bottom: 1em; + margin-left: 0; + list-style-type: none; + padding: 0; +} + +#table-of-contents ul ul { + margin-left: 2.5em; +} + +#description .caption, +#synopsis .caption, +#module-list .caption, +#index .caption { + padding-top: 15px; + font-weight: bold; + font-size: 150% +} + +#synopsis { + margin-bottom: 2em; +} + +#synopsis .expander, +#synopsis .collapser { + background: none; + padding-left: inherit; +} + +#synopsis .hide { + display: inherit; +} + +#synopsis ul { + margin: 0; + padding-top: 0; + padding-left: 20px; + list-style-type: none; +} + +#synopsis li { + margin-top: 8px; + margin-bottom: 8px; + padding: 3px; +} + +#synopsis li li { + padding: 0; + margin-top: 0; + margin-bottom: 0; +} + + +div.top { + margin-top: 1em; + clear: left; + margin-bottom: 1em; +} + +div.top h5 { + margin-left: 10px; +} + + +.src { + padding: 3px; + background-color: #f0f0f0; + font-family: monospace; + margin-bottom: 0; +} + + +.src a.link { + float: right; + border-left-width: 1px; + border-left-color: #000099; + border-left-style: solid; + white-space: nowrap; + font-size: small; + padding: 0 8px 2px 5px; + margin-right: -3px; + background-color: #f0f0f0; +} + +div.subs { + margin-left: 10px; + clear: both; + margin-top: 2px; +} + +.subs dl { + margin-left: 0; +} + +.subs dl dl { + padding-left: 0; + padding-top: 4px; +} + +.subs dd +{ + margin: 2px 0 9px 2em; +} + +.subs dd.empty { + display: none; +} + +.subs table { + margin-left: 10px; + border-spacing: 1px 1px; + margin-top: 4px; + margin-bottom: 4px; +} + +.subs table table { + margin-left: 0; +} + +.arguments .caption, +.fields .caption { + display: none; +} + +/* need extra .subs in the selector to make it override the rules for .subs and .subs table */ + +.subs.arguments { + margin: 0; +} + +.subs.arguments table { + border-spacing: 0; + margin-top: 0; + margin-bottom: 0; +} + +.subs.arguments td.src { + white-space: nowrap; +} + +.subs.arguments + p { + margin-top: 0; +} + +.subs.associated-types, +.subs.methods { + margin-left: 20px; +} + +.subs.associated-types .caption, +.subs.methods .caption { + margin-top: 0.5em; + margin-left: -10px; +} + +.subs.associated-types .src + .src, +.subs.methods .src + .src { + margin-top: 8px; +} + +p.arg { + margin-bottom: 0; +} +p.arg span { + background-color: #f0f0f0; + font-family: monospace; + white-space: nowrap; + float: none; +} + + +img.coll { + width : 0.75em; height: 0.75em; margin-bottom: 0; margin-right: 0.5em +} + + +td.arg { + padding: 3px; + background-color: #f0f0f0; + font-family: monospace; + margin-bottom: 0; +} + +td.rdoc p { + margin-bottom: 0; +} + + + +#footer { + background-color: #000099; + color: #ffffff; + padding: 4px + } + +#footer p { + padding: 1px; + margin: 0; +} + +#footer a:link { + color: #ffffff; + text-decoration: underline + } +#footer a:visited { + color: #ffff00 + } +#footer a:hover { + background-color: #6060ff + } + + +#module-list ul { + list-style: none; + padding-bottom: 15px; + padding-left: 2px; + margin: 0; +} + +#module-list ul ul { + padding-bottom: 0; + padding-left: 20px; +} + +#module-list li .package { + float: right; +} +#mini #module-list .caption { + display: none; +} + +#index .caption { +} + +#alphabet ul { + list-style: none; + padding: 0; + margin: 0.5em 0 0; +} + +#alphabet li { + display: inline; + margin: 0 0.2em; +} + +#index .src { + background: none; + font-family: inherit; +} + +#index td.alt { + padding-left: 2em; +} + +#index td { + padding-top: 2px; + padding-bottom: 1px; + padding-right: 1em; +} + + +#mini h1 { font-size: 130%; } +#mini h2 { font-size: 110%; } +#mini h3 { font-size: 100%; } +#mini h1, #mini h2, #mini h3 { + margin-top: 0.5em; + margin-bottom: 0.25em; + padding: 0 0; +} + +#mini h1 { border-bottom: 1px solid #ccc; } + +#mini #module-header { + margin: 0; + padding: 0; +} +#mini #module-header .caption { + font-size: 130%; + background: #0077dd; + padding: 0.25em; + height: inherit; + margin: 0; +} + +#mini #interface .top { + margin: 0; + padding: 0; +} +#mini #interface .src { + margin: 0; + padding: 0; + font-family: inherit; + background: inherit; +} + +.warning { + color: red; +} diff --git a/resources/html/Ocean.std-theme/hslogo-16.png b/resources/html/Ocean.std-theme/hslogo-16.png new file mode 100644 index 00000000..0ff8579f Binary files /dev/null and b/resources/html/Ocean.std-theme/hslogo-16.png differ diff --git a/resources/html/Ocean.std-theme/minus.gif b/resources/html/Ocean.std-theme/minus.gif new file mode 100644 index 00000000..1deac2fe Binary files /dev/null and b/resources/html/Ocean.std-theme/minus.gif differ diff --git a/resources/html/Ocean.std-theme/ocean.css b/resources/html/Ocean.std-theme/ocean.css new file mode 100644 index 00000000..42238709 --- /dev/null +++ b/resources/html/Ocean.std-theme/ocean.css @@ -0,0 +1,546 @@ +/* @group Fundamentals */ + +* { margin: 0; padding: 0 } + +/* Is this portable? */ +html { + background-color: white; + width: 100%; + height: 100%; +} + +body { + background: white; + color: black; + text-align: left; + min-height: 100%; + position: relative; +} + +p { + margin: 0.8em 0; +} + +ul, ol { + margin: 0.8em 0 0.8em 2em; +} + +dl { + margin: 0.8em 0; +} + +dt { + font-weight: bold; +} +dd { + margin-left: 2em; +} + +a { text-decoration: none; } +a[href]:link { color: rgb(196,69,29); } +a[href]:visited { color: rgb(171,105,84); } +a[href]:hover { text-decoration:underline; } + +/* @end */ + +/* @group Fonts & Sizes */ + +/* Basic technique & IE workarounds from YUI 3 + For reasons, see: + http://yui.yahooapis.com/3.1.1/build/cssfonts/fonts.css + */ + +body { + font:13px/1.4 sans-serif; + *font-size:small; /* for IE */ + *font:x-small; /* for IE in quirks mode */ +} + +h1 { font-size: 146.5%; /* 19pt */ } +h2 { font-size: 131%; /* 17pt */ } +h3 { font-size: 116%; /* 15pt */ } +h4 { font-size: 100%; /* 13pt */ } +h5 { font-size: 100%; /* 13pt */ } + +select, input, button, textarea { + font:99% sans-serif; +} + +table { + font-size:inherit; + font:100%; +} + +pre, code, kbd, samp, tt, .src { + font-family:monospace; + *font-size:108%; + line-height: 124%; +} + +.links, .link { + font-size: 85%; /* 11pt */ +} + +#module-header .caption { + font-size: 182%; /* 24pt */ +} + +.info { + font-size: 85%; /* 11pt */ +} + +#table-of-contents, #synopsis { + /* font-size: 85%; /* 11pt */ +} + + +/* @end */ + +/* @group Common */ + +.caption, h1, h2, h3, h4, h5, h6 { + font-weight: bold; + color: rgb(78,98,114); + margin: 0.8em 0 0.4em; +} + +* + h1, * + h2, * + h3, * + h4, * + h5, * + h6 { + margin-top: 2em; +} + +h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 { + margin-top: inherit; +} + +ul.links { + list-style: none; + text-align: left; + float: right; + display: inline-table; + margin: 0 0 0 1em; +} + +ul.links li { + display: inline; + border-left: 1px solid #d5d5d5; + white-space: nowrap; + padding: 0; +} + +ul.links li a { + padding: 0.2em 0.5em; +} + +.hide { display: none; } +.show { display: inherit; } +.clear { clear: both; } + +.collapser { + background-image: url(minus.gif); + background-repeat: no-repeat; +} +.expander { + background-image: url(plus.gif); + background-repeat: no-repeat; +} +p.caption.collapser, +p.caption.expander { + background-position: 0 0.4em; +} +.collapser, .expander { + padding-left: 14px; + margin-left: -14px; + cursor: pointer; +} + +pre { + padding: 0.25em; + margin: 0.8em 0; + background: rgb(229,237,244); + overflow: auto; + border-bottom: 0.25em solid white; + /* white border adds some space below the box to compensate + for visual extra space that paragraphs have between baseline + and the bounding box */ +} + +.src { + background: #f0f0f0; + padding: 0.2em 0.5em; +} + +.keyword { font-weight: normal; } +.def { font-weight: bold; } + + +/* @end */ + +/* @group Page Structure */ + +#content { + margin: 0 auto; + padding: 0 2em 6em; +} + +#package-header { + background: rgb(41,56,69); + border-top: 5px solid rgb(78,98,114); + color: #ddd; + padding: 0.2em; + position: relative; + text-align: left; +} + +#package-header .caption { + background: url(hslogo-16.png) no-repeat 0em; + color: white; + margin: 0 2em; + font-weight: normal; + font-style: normal; + padding-left: 2em; +} + +#package-header a:link, #package-header a:visited { color: white; } +#package-header a:hover { background: rgb(78,98,114); } + +#module-header .caption { + color: rgb(78,98,114); + font-weight: bold; + border-bottom: 1px solid #ddd; +} + +table.info { + float: right; + padding: 0.5em 1em; + border: 1px solid #ddd; + color: rgb(78,98,114); + background-color: #fff; + max-width: 40%; + border-spacing: 0; + position: relative; + top: -0.5em; + margin: 0 0 0 2em; +} + +.info th { + padding: 0 1em 0 0; +} + +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background: #374c5e; + margin: 0; + text-align: center; + right: 0; + padding: 0; + top: 1.25em; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 0; + color: #000; + list-style-type: none; +} + +#style-menu li + li { + border-top: 1px solid #919191; +} + +#style-menu a { + width: 6em; + padding: 3px; + display: block; +} + +#footer { + background: #ddd; + border-top: 1px solid #aaa; + padding: 0.5em 0; + color: #666; + text-align: center; + position: absolute; + bottom: 0; + width: 100%; + height: 3em; +} + +/* @end */ + +/* @group Front Matter */ + +#table-of-contents { + float: right; + clear: right; + background: #faf9dc; + border: 1px solid #d8d7ad; + padding: 0.5em 1em; + max-width: 20em; + margin: 0.5em 0 1em 1em; +} + +#table-of-contents .caption { + text-align: center; + margin: 0; +} + +#table-of-contents ul { + list-style: none; + margin: 0; +} + +#table-of-contents ul ul { + margin-left: 2em; +} + +#description .caption { + display: none; +} + +#synopsis { + display: none; +} + +.no-frame #synopsis { + display: block; + position: fixed; + right: 0; + height: 80%; + top: 10%; + padding: 0; +} + +#synopsis .caption { + float: left; + width: 29px; + color: rgba(255,255,255,0); + height: 110px; + margin: 0; + font-size: 1px; + padding: 0; +} + +#synopsis p.caption.collapser { + background: url(synopsis.png) no-repeat -64px -8px; +} + +#synopsis p.caption.expander { + background: url(synopsis.png) no-repeat 0px -8px; +} + +#synopsis ul { + height: 100%; + overflow: auto; + padding: 0.5em; + margin: 0; +} + +#synopsis ul ul { + overflow: hidden; +} + +#synopsis ul, +#synopsis ul li.src { + background-color: #faf9dc; + white-space: nowrap; + list-style: none; + margin-left: 0; +} + +/* @end */ + +/* @group Main Content */ + +#interface div.top { margin: 2em 0; } +#interface h1 + div.top, +#interface h2 + div.top, +#interface h3 + div.top, +#interface h4 + div.top, +#interface h5 + div.top { + margin-top: 1em; +} +#interface p.src .link { + float: right; + color: #919191; + border-left: 1px solid #919191; + background: #f0f0f0; + padding: 0 0.5em 0.2em; + margin: 0 -0.5em 0 0.5em; +} + +#interface table { border-spacing: 2px; } +#interface td { + vertical-align: top; + padding-left: 0.5em; +} +#interface td.src { + white-space: nowrap; +} +#interface td.doc p { + margin: 0; +} +#interface td.doc p + p { + margin-top: 0.8em; +} + +.subs dl { + margin: 0; +} + +.subs dt { + float: left; + clear: left; + display: block; + margin: 1px 0; +} + +.subs dd { + float: right; + width: 90%; + display: block; + padding-left: 0.5em; + margin-bottom: 0.5em; +} + +.subs dd.empty { + display: none; +} + +.subs dd p { + margin: 0; +} + +.top p.src { + border-top: 1px solid #ccc; +} + +.subs, .doc { + /* use this selector for one level of indent */ + padding-left: 2em; +} + +.warning { + color: red; +} + +.arguments { + margin-top: -0.4em; +} +.arguments .caption { + display: none; +} + +.fields { padding-left: 1em; } + +.fields .caption { display: none; } + +.fields p { margin: 0 0; } + +/* this seems bulky to me +.methods, .constructors { + background: #f8f8f8; + border: 1px solid #eee; +} +*/ + +/* @end */ + +/* @group Auxillary Pages */ + +#mini { + margin: 0 auto; + padding: 0 1em 1em; +} + +#mini > * { + font-size: 93%; /* 12pt */ +} + +#mini #module-list .caption, +#mini #module-header .caption { + font-size: 125%; /* 15pt */ +} + +#mini #interface h1, +#mini #interface h2, +#mini #interface h3, +#mini #interface h4 { + font-size: 109%; /* 13pt */ + margin: 1em 0 0; +} + +#mini #interface .top, +#mini #interface .src { + margin: 0; +} + +#mini #module-list ul { + list-style: none; + margin: 0; +} + +#alphabet ul { + list-style: none; + padding: 0; + margin: 0.5em 0 0; + text-align: center; +} + +#alphabet li { + display: inline; + margin: 0 0.25em; +} + +#alphabet a { + font-weight: bold; +} + +#index .caption, +#module-list .caption { font-size: 131%; /* 17pt */ } + +#index table { + margin-left: 2em; +} + +#index .src { + font-weight: bold; +} +#index .alt { + font-size: 77%; /* 10pt */ + font-style: italic; + padding-left: 2em; +} + +#index td + td { + padding-left: 1em; +} + +#module-list ul { + list-style: none; + margin: 0 0 0 2em; +} + +#module-list li { + clear: right; +} + +#module-list span.collapser, +#module-list span.expander { + background-position: 0 0.3em; +} + +#module-list .package { + float: right; +} + +/* @end */ diff --git a/resources/html/Ocean.std-theme/plus.gif b/resources/html/Ocean.std-theme/plus.gif new file mode 100644 index 00000000..2d15c141 Binary files /dev/null and b/resources/html/Ocean.std-theme/plus.gif differ diff --git a/resources/html/Ocean.std-theme/synopsis.png b/resources/html/Ocean.std-theme/synopsis.png new file mode 100644 index 00000000..85fb86ec Binary files /dev/null and b/resources/html/Ocean.std-theme/synopsis.png differ diff --git a/resources/html/frames.html b/resources/html/frames.html new file mode 100644 index 00000000..1b4e38d4 --- /dev/null +++ b/resources/html/frames.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + diff --git a/resources/html/haddock-util.js b/resources/html/haddock-util.js new file mode 100644 index 00000000..9a6fccf7 --- /dev/null +++ b/resources/html/haddock-util.js @@ -0,0 +1,344 @@ +// Haddock JavaScript utilities + +var rspace = /\s\s+/g, + rtrim = /^\s+|\s+$/g; + +function spaced(s) { return (" " + s + " ").replace(rspace, " "); } +function trim(s) { return s.replace(rtrim, ""); } + +function hasClass(elem, value) { + var className = spaced(elem.className || ""); + return className.indexOf( " " + value + " " ) >= 0; +} + +function addClass(elem, value) { + var className = spaced(elem.className || ""); + if ( className.indexOf( " " + value + " " ) < 0 ) { + elem.className = trim(className + " " + value); + } +} + +function removeClass(elem, value) { + var className = spaced(elem.className || ""); + className = className.replace(" " + value + " ", " "); + elem.className = trim(className); +} + +function toggleClass(elem, valueOn, valueOff, bool) { + if (bool == null) { bool = ! hasClass(elem, valueOn); } + if (bool) { + removeClass(elem, valueOff); + addClass(elem, valueOn); + } + else { + removeClass(elem, valueOn); + addClass(elem, valueOff); + } + return bool; +} + + +function makeClassToggle(valueOn, valueOff) +{ + return function(elem, bool) { + return toggleClass(elem, valueOn, valueOff, bool); + } +} + +toggleShow = makeClassToggle("show", "hide"); +toggleCollapser = makeClassToggle("collapser", "expander"); + +function toggleSection(id) +{ + var b = toggleShow(document.getElementById("section." + id)); + toggleCollapser(document.getElementById("control." + id), b); + rememberCollapsed(id, b); + return b; +} + +var collapsed = {}; +function rememberCollapsed(id, b) +{ + if(b) + delete collapsed[id] + else + collapsed[id] = null; + + var sections = []; + for(var i in collapsed) + { + if(collapsed.hasOwnProperty(i)) + sections.push(i); + } + // cookie specific to this page; don't use setCookie which sets path=/ + document.cookie = "collapsed=" + escape(sections.join('+')); +} + +function restoreCollapsed() +{ + var cookie = getCookie("collapsed"); + if(!cookie) + return; + + var ids = cookie.split('+'); + for(var i in ids) + { + if(document.getElementById("section." + ids[i])) + toggleSection(ids[i]); + } +} + +function setCookie(name, value) { + document.cookie = name + "=" + escape(value) + ";path=/;"; +} + +function clearCookie(name) { + document.cookie = name + "=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT;"; +} + +function getCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) { + return unescape(c.substring(nameEQ.length,c.length)); + } + } + return null; +} + + + +var max_results = 75; // 50 is not enough to search for map in the base libraries +var shown_range = null; +var last_search = null; + +function quick_search() +{ + perform_search(false); +} + +function full_search() +{ + perform_search(true); +} + + +function perform_search(full) +{ + var text = document.getElementById("searchbox").value.toLowerCase(); + if (text == last_search && !full) return; + last_search = text; + + var table = document.getElementById("indexlist"); + var status = document.getElementById("searchmsg"); + var children = table.firstChild.childNodes; + + // first figure out the first node with the prefix + var first = bisect(-1); + var last = (first == -1 ? -1 : bisect(1)); + + if (first == -1) + { + table.className = ""; + status.innerHTML = "No results found, displaying all"; + } + else if (first == 0 && last == children.length - 1) + { + table.className = ""; + status.innerHTML = ""; + } + else if (last - first >= max_results && !full) + { + table.className = ""; + status.innerHTML = "More than " + max_results + ", press Search to display"; + } + else + { + // decide what you need to clear/show + if (shown_range) + setclass(shown_range[0], shown_range[1], "indexrow"); + setclass(first, last, "indexshow"); + shown_range = [first, last]; + table.className = "indexsearch"; + status.innerHTML = ""; + } + + + function setclass(first, last, status) + { + for (var i = first; i <= last; i++) + { + children[i].className = status; + } + } + + + // do a binary search, treating 0 as ... + // return either -1 (no 0's found) or location of most far match + function bisect(dir) + { + var first = 0, finish = children.length - 1; + var mid, success = false; + + while (finish - first > 3) + { + mid = Math.floor((finish + first) / 2); + + var i = checkitem(mid); + if (i == 0) i = dir; + if (i == -1) + finish = mid; + else + first = mid; + } + var a = (dir == 1 ? first : finish); + var b = (dir == 1 ? finish : first); + for (var i = b; i != a - dir; i -= dir) + { + if (checkitem(i) == 0) return i; + } + return -1; + } + + + // from an index, decide what the result is + // 0 = match, -1 is lower, 1 is higher + function checkitem(i) + { + var s = getitem(i).toLowerCase().substr(0, text.length); + if (s == text) return 0; + else return (s > text ? -1 : 1); + } + + + // from an index, get its string + // this abstracts over alternates + function getitem(i) + { + for ( ; i >= 0; i--) + { + var s = children[i].firstChild.firstChild.data; + if (s.indexOf(' ') == -1) + return s; + } + return ""; // should never be reached + } +} + +function setSynopsis(filename) { + if (parent.window.synopsis) { + if (parent.window.synopsis.location.replace) { + // In Firefox this avoids adding the change to the history. + parent.window.synopsis.location.replace(filename); + } else { + parent.window.synopsis.location = filename; + } + } +} + +function addMenuItem(html) { + var menu = document.getElementById("page-menu"); + if (menu) { + var btn = menu.firstChild.cloneNode(false); + btn.innerHTML = html; + menu.appendChild(btn); + } +} + +function adjustForFrames() { + var bodyCls; + + if (parent.location.href == window.location.href) { + // not in frames, so add Frames button + addMenuItem("Frames"); + bodyCls = "no-frame"; + } + else { + bodyCls = "in-frame"; + } + addClass(document.body, bodyCls); +} + +function reframe() { + setCookie("haddock-reframe", document.URL); + window.location = "frames.html"; +} + +function postReframe() { + var s = getCookie("haddock-reframe"); + if (s) { + parent.window.main.location = s; + clearCookie("haddock-reframe"); + } +} + +function styles() { + var i, a, es = document.getElementsByTagName("link"), rs = []; + for (i = 0; a = es[i]; i++) { + if(a.rel.indexOf("style") != -1 && a.title) { + rs.push(a); + } + } + return rs; +} + +function addStyleMenu() { + var as = styles(); + var i, a, btns = ""; + for(i=0; a = as[i]; i++) { + btns += "
  • " + + a.title + "
  • " + } + if (as.length > 1) { + var h = "
    " + + "Style ▾" + + "
      " + btns + "
    " + + "
    "; + addMenuItem(h); + } +} + +function setActiveStyleSheet(title) { + var as = styles(); + var i, a, found; + for(i=0; a = as[i]; i++) { + a.disabled = true; + // need to do this always, some browsers are edge triggered + if(a.title == title) { + found = a; + } + } + if (found) { + found.disabled = false; + setCookie("haddock-style", title); + } + else { + as[0].disabled = false; + clearCookie("haddock-style"); + } + styleMenu(false); +} + +function resetStyle() { + var s = getCookie("haddock-style"); + if (s) setActiveStyleSheet(s); +} + + +function styleMenu(show) { + var m = document.getElementById('style-menu'); + if (m) toggleShow(m, show); +} + + +function pageLoad() { + addStyleMenu(); + adjustForFrames(); + resetStyle(); + restoreCollapsed(); +} + diff --git a/resources/latex/haddock.sty b/resources/latex/haddock.sty new file mode 100644 index 00000000..6e031a98 --- /dev/null +++ b/resources/latex/haddock.sty @@ -0,0 +1,57 @@ +% Default Haddock style definitions. To use your own style, invoke +% Haddock with the option --latex-style=mystyle. + +\usepackage{tabulary} % see below + +% make hyperlinks in the PDF, and add an expandabale index +\usepackage[pdftex,bookmarks=true]{hyperref} + +\newenvironment{haddocktitle} + {\begin{center}\bgroup\large\bfseries} + {\egroup\end{center}} +\newenvironment{haddockprologue}{\vspace{1in}}{} + +\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}} + +\newcommand{\haddockbeginheader}{\hrulefill} +\newcommand{\haddockendheader}{\noindent\hrulefill} + +% a little gap before the ``Methods'' header +\newcommand{\haddockpremethods}{\vspace{2ex}} + +% inserted before \\begin{verbatim} +\newcommand{\haddockverb}{\small} + +% an identifier: add an index entry +\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}} + +% The tabulary environment lets us have a column that takes up ``the +% rest of the space''. Unfortunately it doesn't allow +% the \end{tabulary} to be in the expansion of a macro, it must appear +% literally in the document text, so Haddock inserts +% the \end{tabulary} itself. +\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} +\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} + +\newcommand{\haddocktt}[1]{{\small \texttt{#1}}} +\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}} + +\makeatletter +\newenvironment{haddockdesc} + {\list{}{\labelwidth\z@ \itemindent-\leftmargin + \let\makelabel\haddocklabel}} + {\endlist} +\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}} +\makeatother + +% after a declaration, start a new line for the documentation. +% Otherwise, the documentation starts right after the declaration, +% because we're using the list environment and the declaration is the +% ``label''. I tried making this newline part of the label, but +% couldn't get that to work reliably (the space seemed to stretch +% sometimes). +\newcommand{\haddockbegindoc}{\hfill\\[1ex]} + +% spacing between paragraphs and no \parindent looks better +\parskip=10pt plus2pt minus2pt +\setlength{\parindent}{0cm} diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs index 28bf2f7e..759f7495 100644 --- a/tests/html-tests/runtests.hs +++ b/tests/html-tests/runtests.hs @@ -1,5 +1,6 @@ import Prelude hiding (mod) import Control.Monad +import Control.Applicative import Data.List import Data.Maybe import Distribution.InstalledPackageInfo @@ -19,8 +20,9 @@ import System.FilePath import System.Process (ProcessHandle, runProcess, waitForProcess) -packageRoot, haddockPath, testSuiteRoot, testDir, outDir :: FilePath +packageRoot, dataDir, haddockPath, testSuiteRoot, testDir, outDir :: FilePath packageRoot = "." +dataDir = packageRoot "resources" haddockPath = packageRoot "dist" "build" "haddock" "haddock" testSuiteRoot = packageRoot "tests" "html-tests" testDir = testSuiteRoot "tests" @@ -48,8 +50,8 @@ test = do let mods' = map (testDir ) mods - env_ <- getEnvironment - let env = Just (("haddock_datadir", packageRoot) : env_) + -- add haddock_datadir to environment for subprocesses + env <- Just . (:) ("haddock_datadir", dataDir) <$> getEnvironment putStrLn "" putStrLn "Haddock version: " -- cgit v1.2.3 From 958d64d77572c47d249965d7146ac17a23de806d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 10:34:28 +0200 Subject: Move HTML tests to directory /html-test/ --- .gitignore | 2 +- haddock.cabal | 6 +- html-test/README | 24 + html-test/accept.hs | 43 + html-test/runtests.hs | 152 ++ html-test/tests/A.hs | 17 + html-test/tests/A.html.ref | 183 ++ html-test/tests/AdvanceTypes.hs | 9 + html-test/tests/AdvanceTypes.html.ref | 97 + html-test/tests/B.hs | 8 + html-test/tests/B.html.ref | 175 ++ html-test/tests/Bug1.hs | 6 + html-test/tests/Bug1.html.ref | 103 + html-test/tests/Bug2.hs | 4 + html-test/tests/Bug2.html.ref | 65 + html-test/tests/Bug3.hs | 6 + html-test/tests/Bug3.html.ref | 83 + html-test/tests/Bug4.hs | 5 + html-test/tests/Bug4.html.ref | 82 + html-test/tests/Bug6.hs | 23 + html-test/tests/Bug6.html.ref | 335 +++ html-test/tests/Bug7.hs | 12 + html-test/tests/Bug7.html.ref | 173 ++ html-test/tests/Bug8.hs | 14 + html-test/tests/Bug8.html.ref | 131 ++ html-test/tests/BugDeprecated.hs | 18 + html-test/tests/BugDeprecated.html.ref | 198 ++ html-test/tests/BugExportHeadings.hs | 29 + html-test/tests/BugExportHeadings.html.ref | 220 ++ html-test/tests/Bugs.hs | 3 + html-test/tests/Bugs.html.ref | 81 + html-test/tests/CrossPackageDocs.hs | 4 + html-test/tests/CrossPackageDocs.html.ref | 298 +++ html-test/tests/DeprecatedClass.hs | 15 + html-test/tests/DeprecatedClass.html.ref | 161 ++ html-test/tests/DeprecatedData.hs | 15 + html-test/tests/DeprecatedData.html.ref | 198 ++ html-test/tests/DeprecatedFunction.hs | 10 + html-test/tests/DeprecatedFunction.html.ref | 110 + html-test/tests/DeprecatedFunction2.hs | 6 + html-test/tests/DeprecatedFunction2.html.ref | 84 + html-test/tests/DeprecatedFunction3.hs | 6 + html-test/tests/DeprecatedFunction3.html.ref | 84 + html-test/tests/DeprecatedModule.hs | 5 + html-test/tests/DeprecatedModule.html.ref | 83 + html-test/tests/DeprecatedModule2.hs | 4 + html-test/tests/DeprecatedModule2.html.ref | 76 + html-test/tests/DeprecatedNewtype.hs | 10 + html-test/tests/DeprecatedNewtype.html.ref | 161 ++ html-test/tests/DeprecatedReExport.hs | 16 + html-test/tests/DeprecatedReExport.html.ref | 133 ++ html-test/tests/DeprecatedRecord.hs | 9 + html-test/tests/DeprecatedRecord.html.ref | 151 ++ html-test/tests/DeprecatedTypeFamily.hs | 9 + html-test/tests/DeprecatedTypeFamily.html.ref | 108 + html-test/tests/DeprecatedTypeSynonym.hs | 9 + html-test/tests/DeprecatedTypeSynonym.html.ref | 116 + html-test/tests/DeprecationMessageParseError.hs | 12 + .../tests/DeprecationMessageParseError.html.ref | 101 + html-test/tests/Examples.hs | 39 + html-test/tests/Examples.html.ref | 179 ++ html-test/tests/FunArgs.hs | 16 + html-test/tests/FunArgs.html.ref | 176 ++ html-test/tests/GADTRecords.hs | 12 + html-test/tests/GADTRecords.html.ref | 234 ++ html-test/tests/Hash.hs | 51 + html-test/tests/Hash.html.ref | 337 +++ html-test/tests/Hidden.hs | 6 + html-test/tests/HiddenInstances.hs | 35 + html-test/tests/HiddenInstances.html.ref | 169 ++ html-test/tests/HiddenInstancesA.hs | 17 + html-test/tests/HiddenInstancesB.hs | 2 + html-test/tests/HiddenInstancesB.html.ref | 143 ++ html-test/tests/Hyperlinks.hs | 8 + html-test/tests/Hyperlinks.html.ref | 89 + html-test/tests/IgnoreExports.hs | 10 + html-test/tests/IgnoreExports.html.ref | 101 + html-test/tests/ModuleWithWarning.hs | 5 + html-test/tests/ModuleWithWarning.html.ref | 83 + html-test/tests/NamedDoc.hs | 4 + html-test/tests/NamedDoc.html.ref | 68 + html-test/tests/NoLayout.hs | 12 + html-test/tests/NoLayout.html.ref | 86 + html-test/tests/NonGreedy.hs | 5 + html-test/tests/NonGreedy.html.ref | 82 + html-test/tests/Properties.hs | 9 + html-test/tests/Properties.html.ref | 92 + html-test/tests/PruneWithWarning.hs | 15 + html-test/tests/PruneWithWarning.html.ref | 72 + html-test/tests/QuasiExpr.hs | 34 + html-test/tests/QuasiExpr.html.ref | 221 ++ html-test/tests/QuasiQuote.hs | 9 + html-test/tests/QuasiQuote.html.ref | 65 + html-test/tests/TH.hs | 8 + html-test/tests/TH.html.ref | 63 + html-test/tests/TH2.hs | 7 + html-test/tests/TH2.html.ref | 63 + html-test/tests/Test.hs | 422 ++++ html-test/tests/Test.html.ref | 2245 ++++++++++++++++++++ html-test/tests/Ticket112.hs | 9 + html-test/tests/Ticket112.html.ref | 82 + html-test/tests/Ticket61.hs | 3 + html-test/tests/Ticket61.html.ref | 80 + html-test/tests/Ticket61_Hidden.hs | 7 + html-test/tests/Ticket75.hs | 7 + html-test/tests/Ticket75.html.ref | 116 + html-test/tests/TypeFamilies.hs | 28 + html-test/tests/TypeFamilies.html.ref | 212 ++ html-test/tests/TypeOperators.hs | 20 + html-test/tests/TypeOperators.html.ref | 185 ++ html-test/tests/Unicode.hs.disabled | 6 + html-test/tests/Unicode.html.ref | 82 + html-test/tests/Visible.hs | 3 + html-test/tests/Visible.html.ref | 67 + html-test/tests/frames.html.ref | 30 + html-test/tests/mini_A.html.ref | 59 + html-test/tests/mini_AdvanceTypes.html.ref | 33 + html-test/tests/mini_B.html.ref | 45 + html-test/tests/mini_Bug1.html.ref | 33 + html-test/tests/mini_Bug2.html.ref | 31 + html-test/tests/mini_Bug3.html.ref | 31 + html-test/tests/mini_Bug4.html.ref | 31 + html-test/tests/mini_Bug6.html.ref | 65 + html-test/tests/mini_Bug7.html.ref | 41 + html-test/tests/mini_Bug8.html.ref | 63 + html-test/tests/mini_BugDeprecated.html.ref | 61 + html-test/tests/mini_BugExportHeadings.html.ref | 79 + html-test/tests/mini_Bugs.html.ref | 33 + html-test/tests/mini_CrossPackageDocs.html.ref | 45 + html-test/tests/mini_DeprecatedClass.html.ref | 41 + html-test/tests/mini_DeprecatedData.html.ref | 41 + html-test/tests/mini_DeprecatedFunction.html.ref | 37 + html-test/tests/mini_DeprecatedFunction2.html.ref | 31 + html-test/tests/mini_DeprecatedFunction3.html.ref | 31 + html-test/tests/mini_DeprecatedModule.html.ref | 31 + html-test/tests/mini_DeprecatedModule2.html.ref | 31 + html-test/tests/mini_DeprecatedNewtype.html.ref | 41 + html-test/tests/mini_DeprecatedReExport.html.ref | 37 + html-test/tests/mini_DeprecatedRecord.html.ref | 33 + html-test/tests/mini_DeprecatedTypeFamily.html.ref | 41 + .../tests/mini_DeprecatedTypeSynonym.html.ref | 41 + .../mini_DeprecationMessageParseError.html.ref | 31 + html-test/tests/mini_Examples.html.ref | 31 + html-test/tests/mini_FunArgs.html.ref | 37 + html-test/tests/mini_GADTRecords.html.ref | 33 + html-test/tests/mini_Hash.html.ref | 74 + html-test/tests/mini_HiddenInstances.html.ref | 41 + html-test/tests/mini_HiddenInstancesB.html.ref | 41 + html-test/tests/mini_Hyperlinks.html.ref | 31 + html-test/tests/mini_IgnoreExports.html.ref | 37 + html-test/tests/mini_ModuleWithWarning.html.ref | 31 + html-test/tests/mini_NamedDoc.html.ref | 25 + html-test/tests/mini_NoLayout.html.ref | 31 + html-test/tests/mini_NonGreedy.html.ref | 31 + html-test/tests/mini_Properties.html.ref | 31 + html-test/tests/mini_PruneWithWarning.html.ref | 25 + html-test/tests/mini_QuasiExpr.html.ref | 59 + html-test/tests/mini_QuasiQuote.html.ref | 31 + html-test/tests/mini_TH.html.ref | 31 + html-test/tests/mini_TH2.html.ref | 31 + html-test/tests/mini_Test.html.ref | 269 +++ html-test/tests/mini_Ticket112.html.ref | 31 + html-test/tests/mini_Ticket61.html.ref | 33 + html-test/tests/mini_Ticket75.html.ref | 39 + html-test/tests/mini_TypeFamilies.html.ref | 55 + html-test/tests/mini_TypeOperators.html.ref | 66 + html-test/tests/mini_Unicode.html.ref | 31 + html-test/tests/mini_Visible.html.ref | 31 + tests/html-tests/README | 24 - tests/html-tests/accept.hs | 43 - tests/html-tests/runtests.hs | 152 -- tests/html-tests/tests/A.hs | 17 - tests/html-tests/tests/A.html.ref | 183 -- tests/html-tests/tests/AdvanceTypes.hs | 9 - tests/html-tests/tests/AdvanceTypes.html.ref | 97 - tests/html-tests/tests/B.hs | 8 - tests/html-tests/tests/B.html.ref | 175 -- tests/html-tests/tests/Bug1.hs | 6 - tests/html-tests/tests/Bug1.html.ref | 103 - tests/html-tests/tests/Bug2.hs | 4 - tests/html-tests/tests/Bug2.html.ref | 65 - tests/html-tests/tests/Bug3.hs | 6 - tests/html-tests/tests/Bug3.html.ref | 83 - tests/html-tests/tests/Bug4.hs | 5 - tests/html-tests/tests/Bug4.html.ref | 82 - tests/html-tests/tests/Bug6.hs | 23 - tests/html-tests/tests/Bug6.html.ref | 335 --- tests/html-tests/tests/Bug7.hs | 12 - tests/html-tests/tests/Bug7.html.ref | 173 -- tests/html-tests/tests/Bug8.hs | 14 - tests/html-tests/tests/Bug8.html.ref | 131 -- tests/html-tests/tests/BugDeprecated.hs | 18 - tests/html-tests/tests/BugDeprecated.html.ref | 198 -- tests/html-tests/tests/BugExportHeadings.hs | 29 - tests/html-tests/tests/BugExportHeadings.html.ref | 220 -- tests/html-tests/tests/Bugs.hs | 3 - tests/html-tests/tests/Bugs.html.ref | 81 - tests/html-tests/tests/CrossPackageDocs.hs | 4 - tests/html-tests/tests/CrossPackageDocs.html.ref | 298 --- tests/html-tests/tests/DeprecatedClass.hs | 15 - tests/html-tests/tests/DeprecatedClass.html.ref | 161 -- tests/html-tests/tests/DeprecatedData.hs | 15 - tests/html-tests/tests/DeprecatedData.html.ref | 198 -- tests/html-tests/tests/DeprecatedFunction.hs | 10 - tests/html-tests/tests/DeprecatedFunction.html.ref | 110 - tests/html-tests/tests/DeprecatedFunction2.hs | 6 - .../html-tests/tests/DeprecatedFunction2.html.ref | 84 - tests/html-tests/tests/DeprecatedFunction3.hs | 6 - .../html-tests/tests/DeprecatedFunction3.html.ref | 84 - tests/html-tests/tests/DeprecatedModule.hs | 5 - tests/html-tests/tests/DeprecatedModule.html.ref | 83 - tests/html-tests/tests/DeprecatedModule2.hs | 4 - tests/html-tests/tests/DeprecatedModule2.html.ref | 76 - tests/html-tests/tests/DeprecatedNewtype.hs | 10 - tests/html-tests/tests/DeprecatedNewtype.html.ref | 161 -- tests/html-tests/tests/DeprecatedReExport.hs | 16 - tests/html-tests/tests/DeprecatedReExport.html.ref | 133 -- tests/html-tests/tests/DeprecatedRecord.hs | 9 - tests/html-tests/tests/DeprecatedRecord.html.ref | 151 -- tests/html-tests/tests/DeprecatedTypeFamily.hs | 9 - .../html-tests/tests/DeprecatedTypeFamily.html.ref | 108 - tests/html-tests/tests/DeprecatedTypeSynonym.hs | 9 - .../tests/DeprecatedTypeSynonym.html.ref | 116 - .../tests/DeprecationMessageParseError.hs | 12 - .../tests/DeprecationMessageParseError.html.ref | 101 - tests/html-tests/tests/Examples.hs | 39 - tests/html-tests/tests/Examples.html.ref | 179 -- tests/html-tests/tests/FunArgs.hs | 16 - tests/html-tests/tests/FunArgs.html.ref | 176 -- tests/html-tests/tests/GADTRecords.hs | 12 - tests/html-tests/tests/GADTRecords.html.ref | 234 -- tests/html-tests/tests/Hash.hs | 51 - tests/html-tests/tests/Hash.html.ref | 337 --- tests/html-tests/tests/Hidden.hs | 6 - tests/html-tests/tests/HiddenInstances.hs | 35 - tests/html-tests/tests/HiddenInstances.html.ref | 169 -- tests/html-tests/tests/HiddenInstancesA.hs | 17 - tests/html-tests/tests/HiddenInstancesB.hs | 2 - tests/html-tests/tests/HiddenInstancesB.html.ref | 143 -- tests/html-tests/tests/Hyperlinks.hs | 8 - tests/html-tests/tests/Hyperlinks.html.ref | 89 - tests/html-tests/tests/IgnoreExports.hs | 10 - tests/html-tests/tests/IgnoreExports.html.ref | 101 - tests/html-tests/tests/ModuleWithWarning.hs | 5 - tests/html-tests/tests/ModuleWithWarning.html.ref | 83 - tests/html-tests/tests/NamedDoc.hs | 4 - tests/html-tests/tests/NamedDoc.html.ref | 68 - tests/html-tests/tests/NoLayout.hs | 12 - tests/html-tests/tests/NoLayout.html.ref | 86 - tests/html-tests/tests/NonGreedy.hs | 5 - tests/html-tests/tests/NonGreedy.html.ref | 82 - tests/html-tests/tests/Properties.hs | 9 - tests/html-tests/tests/Properties.html.ref | 92 - tests/html-tests/tests/PruneWithWarning.hs | 15 - tests/html-tests/tests/PruneWithWarning.html.ref | 72 - tests/html-tests/tests/QuasiExpr.hs | 34 - tests/html-tests/tests/QuasiExpr.html.ref | 221 -- tests/html-tests/tests/QuasiQuote.hs | 9 - tests/html-tests/tests/QuasiQuote.html.ref | 65 - tests/html-tests/tests/TH.hs | 8 - tests/html-tests/tests/TH.html.ref | 63 - tests/html-tests/tests/TH2.hs | 7 - tests/html-tests/tests/TH2.html.ref | 63 - tests/html-tests/tests/Test.hs | 422 ---- tests/html-tests/tests/Test.html.ref | 2245 -------------------- tests/html-tests/tests/Ticket112.hs | 9 - tests/html-tests/tests/Ticket112.html.ref | 82 - tests/html-tests/tests/Ticket61.hs | 3 - tests/html-tests/tests/Ticket61.html.ref | 80 - tests/html-tests/tests/Ticket61_Hidden.hs | 7 - tests/html-tests/tests/Ticket75.hs | 7 - tests/html-tests/tests/Ticket75.html.ref | 116 - tests/html-tests/tests/TypeFamilies.hs | 28 - tests/html-tests/tests/TypeFamilies.html.ref | 212 -- tests/html-tests/tests/TypeOperators.hs | 20 - tests/html-tests/tests/TypeOperators.html.ref | 185 -- tests/html-tests/tests/Unicode.hs.disabled | 6 - tests/html-tests/tests/Unicode.html.ref | 82 - tests/html-tests/tests/Visible.hs | 3 - tests/html-tests/tests/Visible.html.ref | 67 - tests/html-tests/tests/frames.html.ref | 30 - tests/html-tests/tests/mini_A.html.ref | 59 - tests/html-tests/tests/mini_AdvanceTypes.html.ref | 33 - tests/html-tests/tests/mini_B.html.ref | 45 - tests/html-tests/tests/mini_Bug1.html.ref | 33 - tests/html-tests/tests/mini_Bug2.html.ref | 31 - tests/html-tests/tests/mini_Bug3.html.ref | 31 - tests/html-tests/tests/mini_Bug4.html.ref | 31 - tests/html-tests/tests/mini_Bug6.html.ref | 65 - tests/html-tests/tests/mini_Bug7.html.ref | 41 - tests/html-tests/tests/mini_Bug8.html.ref | 63 - tests/html-tests/tests/mini_BugDeprecated.html.ref | 61 - .../tests/mini_BugExportHeadings.html.ref | 79 - tests/html-tests/tests/mini_Bugs.html.ref | 33 - .../tests/mini_CrossPackageDocs.html.ref | 45 - .../html-tests/tests/mini_DeprecatedClass.html.ref | 41 - .../html-tests/tests/mini_DeprecatedData.html.ref | 41 - .../tests/mini_DeprecatedFunction.html.ref | 37 - .../tests/mini_DeprecatedFunction2.html.ref | 31 - .../tests/mini_DeprecatedFunction3.html.ref | 31 - .../tests/mini_DeprecatedModule.html.ref | 31 - .../tests/mini_DeprecatedModule2.html.ref | 31 - .../tests/mini_DeprecatedNewtype.html.ref | 41 - .../tests/mini_DeprecatedReExport.html.ref | 37 - .../tests/mini_DeprecatedRecord.html.ref | 33 - .../tests/mini_DeprecatedTypeFamily.html.ref | 41 - .../tests/mini_DeprecatedTypeSynonym.html.ref | 41 - .../mini_DeprecationMessageParseError.html.ref | 31 - tests/html-tests/tests/mini_Examples.html.ref | 31 - tests/html-tests/tests/mini_FunArgs.html.ref | 37 - tests/html-tests/tests/mini_GADTRecords.html.ref | 33 - tests/html-tests/tests/mini_Hash.html.ref | 74 - .../html-tests/tests/mini_HiddenInstances.html.ref | 41 - .../tests/mini_HiddenInstancesB.html.ref | 41 - tests/html-tests/tests/mini_Hyperlinks.html.ref | 31 - tests/html-tests/tests/mini_IgnoreExports.html.ref | 37 - .../tests/mini_ModuleWithWarning.html.ref | 31 - tests/html-tests/tests/mini_NamedDoc.html.ref | 25 - tests/html-tests/tests/mini_NoLayout.html.ref | 31 - tests/html-tests/tests/mini_NonGreedy.html.ref | 31 - tests/html-tests/tests/mini_Properties.html.ref | 31 - .../tests/mini_PruneWithWarning.html.ref | 25 - tests/html-tests/tests/mini_QuasiExpr.html.ref | 59 - tests/html-tests/tests/mini_QuasiQuote.html.ref | 31 - tests/html-tests/tests/mini_TH.html.ref | 31 - tests/html-tests/tests/mini_TH2.html.ref | 31 - tests/html-tests/tests/mini_Test.html.ref | 269 --- tests/html-tests/tests/mini_Ticket112.html.ref | 31 - tests/html-tests/tests/mini_Ticket61.html.ref | 33 - tests/html-tests/tests/mini_Ticket75.html.ref | 39 - tests/html-tests/tests/mini_TypeFamilies.html.ref | 55 - tests/html-tests/tests/mini_TypeOperators.html.ref | 66 - tests/html-tests/tests/mini_Unicode.html.ref | 31 - tests/html-tests/tests/mini_Visible.html.ref | 31 - 334 files changed, 12851 insertions(+), 12851 deletions(-) create mode 100644 html-test/README create mode 100644 html-test/accept.hs create mode 100644 html-test/runtests.hs create mode 100644 html-test/tests/A.hs create mode 100644 html-test/tests/A.html.ref create mode 100644 html-test/tests/AdvanceTypes.hs create mode 100644 html-test/tests/AdvanceTypes.html.ref create mode 100644 html-test/tests/B.hs create mode 100644 html-test/tests/B.html.ref create mode 100644 html-test/tests/Bug1.hs create mode 100644 html-test/tests/Bug1.html.ref create mode 100644 html-test/tests/Bug2.hs create mode 100644 html-test/tests/Bug2.html.ref create mode 100644 html-test/tests/Bug3.hs create mode 100644 html-test/tests/Bug3.html.ref create mode 100644 html-test/tests/Bug4.hs create mode 100644 html-test/tests/Bug4.html.ref create mode 100644 html-test/tests/Bug6.hs create mode 100644 html-test/tests/Bug6.html.ref create mode 100644 html-test/tests/Bug7.hs create mode 100644 html-test/tests/Bug7.html.ref create mode 100644 html-test/tests/Bug8.hs create mode 100644 html-test/tests/Bug8.html.ref create mode 100644 html-test/tests/BugDeprecated.hs create mode 100644 html-test/tests/BugDeprecated.html.ref create mode 100644 html-test/tests/BugExportHeadings.hs create mode 100644 html-test/tests/BugExportHeadings.html.ref create mode 100644 html-test/tests/Bugs.hs create mode 100644 html-test/tests/Bugs.html.ref create mode 100644 html-test/tests/CrossPackageDocs.hs create mode 100644 html-test/tests/CrossPackageDocs.html.ref create mode 100644 html-test/tests/DeprecatedClass.hs create mode 100644 html-test/tests/DeprecatedClass.html.ref create mode 100644 html-test/tests/DeprecatedData.hs create mode 100644 html-test/tests/DeprecatedData.html.ref create mode 100644 html-test/tests/DeprecatedFunction.hs create mode 100644 html-test/tests/DeprecatedFunction.html.ref create mode 100644 html-test/tests/DeprecatedFunction2.hs create mode 100644 html-test/tests/DeprecatedFunction2.html.ref create mode 100644 html-test/tests/DeprecatedFunction3.hs create mode 100644 html-test/tests/DeprecatedFunction3.html.ref create mode 100644 html-test/tests/DeprecatedModule.hs create mode 100644 html-test/tests/DeprecatedModule.html.ref create mode 100644 html-test/tests/DeprecatedModule2.hs create mode 100644 html-test/tests/DeprecatedModule2.html.ref create mode 100644 html-test/tests/DeprecatedNewtype.hs create mode 100644 html-test/tests/DeprecatedNewtype.html.ref create mode 100644 html-test/tests/DeprecatedReExport.hs create mode 100644 html-test/tests/DeprecatedReExport.html.ref create mode 100644 html-test/tests/DeprecatedRecord.hs create mode 100644 html-test/tests/DeprecatedRecord.html.ref create mode 100644 html-test/tests/DeprecatedTypeFamily.hs create mode 100644 html-test/tests/DeprecatedTypeFamily.html.ref create mode 100644 html-test/tests/DeprecatedTypeSynonym.hs create mode 100644 html-test/tests/DeprecatedTypeSynonym.html.ref create mode 100644 html-test/tests/DeprecationMessageParseError.hs create mode 100644 html-test/tests/DeprecationMessageParseError.html.ref create mode 100644 html-test/tests/Examples.hs create mode 100644 html-test/tests/Examples.html.ref create mode 100644 html-test/tests/FunArgs.hs create mode 100644 html-test/tests/FunArgs.html.ref create mode 100644 html-test/tests/GADTRecords.hs create mode 100644 html-test/tests/GADTRecords.html.ref create mode 100644 html-test/tests/Hash.hs create mode 100644 html-test/tests/Hash.html.ref create mode 100644 html-test/tests/Hidden.hs create mode 100644 html-test/tests/HiddenInstances.hs create mode 100644 html-test/tests/HiddenInstances.html.ref create mode 100644 html-test/tests/HiddenInstancesA.hs create mode 100644 html-test/tests/HiddenInstancesB.hs create mode 100644 html-test/tests/HiddenInstancesB.html.ref create mode 100644 html-test/tests/Hyperlinks.hs create mode 100644 html-test/tests/Hyperlinks.html.ref create mode 100644 html-test/tests/IgnoreExports.hs create mode 100644 html-test/tests/IgnoreExports.html.ref create mode 100644 html-test/tests/ModuleWithWarning.hs create mode 100644 html-test/tests/ModuleWithWarning.html.ref create mode 100644 html-test/tests/NamedDoc.hs create mode 100644 html-test/tests/NamedDoc.html.ref create mode 100644 html-test/tests/NoLayout.hs create mode 100644 html-test/tests/NoLayout.html.ref create mode 100644 html-test/tests/NonGreedy.hs create mode 100644 html-test/tests/NonGreedy.html.ref create mode 100644 html-test/tests/Properties.hs create mode 100644 html-test/tests/Properties.html.ref create mode 100644 html-test/tests/PruneWithWarning.hs create mode 100644 html-test/tests/PruneWithWarning.html.ref create mode 100644 html-test/tests/QuasiExpr.hs create mode 100644 html-test/tests/QuasiExpr.html.ref create mode 100644 html-test/tests/QuasiQuote.hs create mode 100644 html-test/tests/QuasiQuote.html.ref create mode 100644 html-test/tests/TH.hs create mode 100644 html-test/tests/TH.html.ref create mode 100644 html-test/tests/TH2.hs create mode 100644 html-test/tests/TH2.html.ref create mode 100644 html-test/tests/Test.hs create mode 100644 html-test/tests/Test.html.ref create mode 100644 html-test/tests/Ticket112.hs create mode 100644 html-test/tests/Ticket112.html.ref create mode 100644 html-test/tests/Ticket61.hs create mode 100644 html-test/tests/Ticket61.html.ref create mode 100644 html-test/tests/Ticket61_Hidden.hs create mode 100644 html-test/tests/Ticket75.hs create mode 100644 html-test/tests/Ticket75.html.ref create mode 100644 html-test/tests/TypeFamilies.hs create mode 100644 html-test/tests/TypeFamilies.html.ref create mode 100644 html-test/tests/TypeOperators.hs create mode 100644 html-test/tests/TypeOperators.html.ref create mode 100644 html-test/tests/Unicode.hs.disabled create mode 100644 html-test/tests/Unicode.html.ref create mode 100644 html-test/tests/Visible.hs create mode 100644 html-test/tests/Visible.html.ref create mode 100644 html-test/tests/frames.html.ref create mode 100644 html-test/tests/mini_A.html.ref create mode 100644 html-test/tests/mini_AdvanceTypes.html.ref create mode 100644 html-test/tests/mini_B.html.ref create mode 100644 html-test/tests/mini_Bug1.html.ref create mode 100644 html-test/tests/mini_Bug2.html.ref create mode 100644 html-test/tests/mini_Bug3.html.ref create mode 100644 html-test/tests/mini_Bug4.html.ref create mode 100644 html-test/tests/mini_Bug6.html.ref create mode 100644 html-test/tests/mini_Bug7.html.ref create mode 100644 html-test/tests/mini_Bug8.html.ref create mode 100644 html-test/tests/mini_BugDeprecated.html.ref create mode 100644 html-test/tests/mini_BugExportHeadings.html.ref create mode 100644 html-test/tests/mini_Bugs.html.ref create mode 100644 html-test/tests/mini_CrossPackageDocs.html.ref create mode 100644 html-test/tests/mini_DeprecatedClass.html.ref create mode 100644 html-test/tests/mini_DeprecatedData.html.ref create mode 100644 html-test/tests/mini_DeprecatedFunction.html.ref create mode 100644 html-test/tests/mini_DeprecatedFunction2.html.ref create mode 100644 html-test/tests/mini_DeprecatedFunction3.html.ref create mode 100644 html-test/tests/mini_DeprecatedModule.html.ref create mode 100644 html-test/tests/mini_DeprecatedModule2.html.ref create mode 100644 html-test/tests/mini_DeprecatedNewtype.html.ref create mode 100644 html-test/tests/mini_DeprecatedReExport.html.ref create mode 100644 html-test/tests/mini_DeprecatedRecord.html.ref create mode 100644 html-test/tests/mini_DeprecatedTypeFamily.html.ref create mode 100644 html-test/tests/mini_DeprecatedTypeSynonym.html.ref create mode 100644 html-test/tests/mini_DeprecationMessageParseError.html.ref create mode 100644 html-test/tests/mini_Examples.html.ref create mode 100644 html-test/tests/mini_FunArgs.html.ref create mode 100644 html-test/tests/mini_GADTRecords.html.ref create mode 100644 html-test/tests/mini_Hash.html.ref create mode 100644 html-test/tests/mini_HiddenInstances.html.ref create mode 100644 html-test/tests/mini_HiddenInstancesB.html.ref create mode 100644 html-test/tests/mini_Hyperlinks.html.ref create mode 100644 html-test/tests/mini_IgnoreExports.html.ref create mode 100644 html-test/tests/mini_ModuleWithWarning.html.ref create mode 100644 html-test/tests/mini_NamedDoc.html.ref create mode 100644 html-test/tests/mini_NoLayout.html.ref create mode 100644 html-test/tests/mini_NonGreedy.html.ref create mode 100644 html-test/tests/mini_Properties.html.ref create mode 100644 html-test/tests/mini_PruneWithWarning.html.ref create mode 100644 html-test/tests/mini_QuasiExpr.html.ref create mode 100644 html-test/tests/mini_QuasiQuote.html.ref create mode 100644 html-test/tests/mini_TH.html.ref create mode 100644 html-test/tests/mini_TH2.html.ref create mode 100644 html-test/tests/mini_Test.html.ref create mode 100644 html-test/tests/mini_Ticket112.html.ref create mode 100644 html-test/tests/mini_Ticket61.html.ref create mode 100644 html-test/tests/mini_Ticket75.html.ref create mode 100644 html-test/tests/mini_TypeFamilies.html.ref create mode 100644 html-test/tests/mini_TypeOperators.html.ref create mode 100644 html-test/tests/mini_Unicode.html.ref create mode 100644 html-test/tests/mini_Visible.html.ref delete mode 100644 tests/html-tests/README delete mode 100644 tests/html-tests/accept.hs delete mode 100644 tests/html-tests/runtests.hs delete mode 100644 tests/html-tests/tests/A.hs delete mode 100644 tests/html-tests/tests/A.html.ref delete mode 100644 tests/html-tests/tests/AdvanceTypes.hs delete mode 100644 tests/html-tests/tests/AdvanceTypes.html.ref delete mode 100644 tests/html-tests/tests/B.hs delete mode 100644 tests/html-tests/tests/B.html.ref delete mode 100644 tests/html-tests/tests/Bug1.hs delete mode 100644 tests/html-tests/tests/Bug1.html.ref delete mode 100644 tests/html-tests/tests/Bug2.hs delete mode 100644 tests/html-tests/tests/Bug2.html.ref delete mode 100644 tests/html-tests/tests/Bug3.hs delete mode 100644 tests/html-tests/tests/Bug3.html.ref delete mode 100644 tests/html-tests/tests/Bug4.hs delete mode 100644 tests/html-tests/tests/Bug4.html.ref delete mode 100644 tests/html-tests/tests/Bug6.hs delete mode 100644 tests/html-tests/tests/Bug6.html.ref delete mode 100644 tests/html-tests/tests/Bug7.hs delete mode 100644 tests/html-tests/tests/Bug7.html.ref delete mode 100644 tests/html-tests/tests/Bug8.hs delete mode 100644 tests/html-tests/tests/Bug8.html.ref delete mode 100644 tests/html-tests/tests/BugDeprecated.hs delete mode 100644 tests/html-tests/tests/BugDeprecated.html.ref delete mode 100644 tests/html-tests/tests/BugExportHeadings.hs delete mode 100644 tests/html-tests/tests/BugExportHeadings.html.ref delete mode 100644 tests/html-tests/tests/Bugs.hs delete mode 100644 tests/html-tests/tests/Bugs.html.ref delete mode 100644 tests/html-tests/tests/CrossPackageDocs.hs delete mode 100644 tests/html-tests/tests/CrossPackageDocs.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedClass.hs delete mode 100644 tests/html-tests/tests/DeprecatedClass.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedData.hs delete mode 100644 tests/html-tests/tests/DeprecatedData.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedFunction.hs delete mode 100644 tests/html-tests/tests/DeprecatedFunction.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedFunction2.hs delete mode 100644 tests/html-tests/tests/DeprecatedFunction2.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedFunction3.hs delete mode 100644 tests/html-tests/tests/DeprecatedFunction3.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedModule.hs delete mode 100644 tests/html-tests/tests/DeprecatedModule.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedModule2.hs delete mode 100644 tests/html-tests/tests/DeprecatedModule2.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedNewtype.hs delete mode 100644 tests/html-tests/tests/DeprecatedNewtype.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedReExport.hs delete mode 100644 tests/html-tests/tests/DeprecatedReExport.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedRecord.hs delete mode 100644 tests/html-tests/tests/DeprecatedRecord.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedTypeFamily.hs delete mode 100644 tests/html-tests/tests/DeprecatedTypeFamily.html.ref delete mode 100644 tests/html-tests/tests/DeprecatedTypeSynonym.hs delete mode 100644 tests/html-tests/tests/DeprecatedTypeSynonym.html.ref delete mode 100644 tests/html-tests/tests/DeprecationMessageParseError.hs delete mode 100644 tests/html-tests/tests/DeprecationMessageParseError.html.ref delete mode 100644 tests/html-tests/tests/Examples.hs delete mode 100644 tests/html-tests/tests/Examples.html.ref delete mode 100644 tests/html-tests/tests/FunArgs.hs delete mode 100644 tests/html-tests/tests/FunArgs.html.ref delete mode 100644 tests/html-tests/tests/GADTRecords.hs delete mode 100644 tests/html-tests/tests/GADTRecords.html.ref delete mode 100644 tests/html-tests/tests/Hash.hs delete mode 100644 tests/html-tests/tests/Hash.html.ref delete mode 100644 tests/html-tests/tests/Hidden.hs delete mode 100644 tests/html-tests/tests/HiddenInstances.hs delete mode 100644 tests/html-tests/tests/HiddenInstances.html.ref delete mode 100644 tests/html-tests/tests/HiddenInstancesA.hs delete mode 100644 tests/html-tests/tests/HiddenInstancesB.hs delete mode 100644 tests/html-tests/tests/HiddenInstancesB.html.ref delete mode 100644 tests/html-tests/tests/Hyperlinks.hs delete mode 100644 tests/html-tests/tests/Hyperlinks.html.ref delete mode 100644 tests/html-tests/tests/IgnoreExports.hs delete mode 100644 tests/html-tests/tests/IgnoreExports.html.ref delete mode 100644 tests/html-tests/tests/ModuleWithWarning.hs delete mode 100644 tests/html-tests/tests/ModuleWithWarning.html.ref delete mode 100644 tests/html-tests/tests/NamedDoc.hs delete mode 100644 tests/html-tests/tests/NamedDoc.html.ref delete mode 100644 tests/html-tests/tests/NoLayout.hs delete mode 100644 tests/html-tests/tests/NoLayout.html.ref delete mode 100644 tests/html-tests/tests/NonGreedy.hs delete mode 100644 tests/html-tests/tests/NonGreedy.html.ref delete mode 100644 tests/html-tests/tests/Properties.hs delete mode 100644 tests/html-tests/tests/Properties.html.ref delete mode 100644 tests/html-tests/tests/PruneWithWarning.hs delete mode 100644 tests/html-tests/tests/PruneWithWarning.html.ref delete mode 100644 tests/html-tests/tests/QuasiExpr.hs delete mode 100644 tests/html-tests/tests/QuasiExpr.html.ref delete mode 100644 tests/html-tests/tests/QuasiQuote.hs delete mode 100644 tests/html-tests/tests/QuasiQuote.html.ref delete mode 100644 tests/html-tests/tests/TH.hs delete mode 100644 tests/html-tests/tests/TH.html.ref delete mode 100644 tests/html-tests/tests/TH2.hs delete mode 100644 tests/html-tests/tests/TH2.html.ref delete mode 100644 tests/html-tests/tests/Test.hs delete mode 100644 tests/html-tests/tests/Test.html.ref delete mode 100644 tests/html-tests/tests/Ticket112.hs delete mode 100644 tests/html-tests/tests/Ticket112.html.ref delete mode 100644 tests/html-tests/tests/Ticket61.hs delete mode 100644 tests/html-tests/tests/Ticket61.html.ref delete mode 100644 tests/html-tests/tests/Ticket61_Hidden.hs delete mode 100644 tests/html-tests/tests/Ticket75.hs delete mode 100644 tests/html-tests/tests/Ticket75.html.ref delete mode 100644 tests/html-tests/tests/TypeFamilies.hs delete mode 100644 tests/html-tests/tests/TypeFamilies.html.ref delete mode 100644 tests/html-tests/tests/TypeOperators.hs delete mode 100644 tests/html-tests/tests/TypeOperators.html.ref delete mode 100644 tests/html-tests/tests/Unicode.hs.disabled delete mode 100644 tests/html-tests/tests/Unicode.html.ref delete mode 100644 tests/html-tests/tests/Visible.hs delete mode 100644 tests/html-tests/tests/Visible.html.ref delete mode 100644 tests/html-tests/tests/frames.html.ref delete mode 100644 tests/html-tests/tests/mini_A.html.ref delete mode 100644 tests/html-tests/tests/mini_AdvanceTypes.html.ref delete mode 100644 tests/html-tests/tests/mini_B.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug1.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug2.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug3.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug4.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug6.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug7.html.ref delete mode 100644 tests/html-tests/tests/mini_Bug8.html.ref delete mode 100644 tests/html-tests/tests/mini_BugDeprecated.html.ref delete mode 100644 tests/html-tests/tests/mini_BugExportHeadings.html.ref delete mode 100644 tests/html-tests/tests/mini_Bugs.html.ref delete mode 100644 tests/html-tests/tests/mini_CrossPackageDocs.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedClass.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedData.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedFunction.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedFunction2.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedFunction3.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedModule.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedModule2.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedNewtype.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedReExport.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedRecord.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedTypeFamily.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecatedTypeSynonym.html.ref delete mode 100644 tests/html-tests/tests/mini_DeprecationMessageParseError.html.ref delete mode 100644 tests/html-tests/tests/mini_Examples.html.ref delete mode 100644 tests/html-tests/tests/mini_FunArgs.html.ref delete mode 100644 tests/html-tests/tests/mini_GADTRecords.html.ref delete mode 100644 tests/html-tests/tests/mini_Hash.html.ref delete mode 100644 tests/html-tests/tests/mini_HiddenInstances.html.ref delete mode 100644 tests/html-tests/tests/mini_HiddenInstancesB.html.ref delete mode 100644 tests/html-tests/tests/mini_Hyperlinks.html.ref delete mode 100644 tests/html-tests/tests/mini_IgnoreExports.html.ref delete mode 100644 tests/html-tests/tests/mini_ModuleWithWarning.html.ref delete mode 100644 tests/html-tests/tests/mini_NamedDoc.html.ref delete mode 100644 tests/html-tests/tests/mini_NoLayout.html.ref delete mode 100644 tests/html-tests/tests/mini_NonGreedy.html.ref delete mode 100644 tests/html-tests/tests/mini_Properties.html.ref delete mode 100644 tests/html-tests/tests/mini_PruneWithWarning.html.ref delete mode 100644 tests/html-tests/tests/mini_QuasiExpr.html.ref delete mode 100644 tests/html-tests/tests/mini_QuasiQuote.html.ref delete mode 100644 tests/html-tests/tests/mini_TH.html.ref delete mode 100644 tests/html-tests/tests/mini_TH2.html.ref delete mode 100644 tests/html-tests/tests/mini_Test.html.ref delete mode 100644 tests/html-tests/tests/mini_Ticket112.html.ref delete mode 100644 tests/html-tests/tests/mini_Ticket61.html.ref delete mode 100644 tests/html-tests/tests/mini_Ticket75.html.ref delete mode 100644 tests/html-tests/tests/mini_TypeFamilies.html.ref delete mode 100644 tests/html-tests/tests/mini_TypeOperators.html.ref delete mode 100644 tests/html-tests/tests/mini_Unicode.html.ref delete mode 100644 tests/html-tests/tests/mini_Visible.html.ref (limited to 'tests') diff --git a/.gitignore b/.gitignore index ba90347e..3d242029 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /dist/ -/tests/html-tests/output/ +/html-test/output/ /doc/haddock /doc/autom4te.cache/ diff --git a/haddock.cabal b/haddock.cabal index 846d7c6a..36c016e9 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -31,7 +31,7 @@ extra-source-files: src/haddock.sh -- The test files shouldn't have to go here, but the source files for -- the test-suite stanzas don't get picked up by `cabal sdist`. - tests/html-tests/runtests.hs + tests/html-test/runtests.hs data-dir: resources data-files: html/frames.html @@ -169,11 +169,11 @@ library if flag(in-ghc-tree) buildable: False -test-suite html-tests +test-suite html-test type: exitcode-stdio-1.0 default-language: Haskell2010 main-is: runtests.hs - hs-source-dirs: tests/html-tests + hs-source-dirs: html-test build-depends: base, directory, process, filepath, Cabal test-suite spec diff --git a/html-test/README b/html-test/README new file mode 100644 index 00000000..9afb10e7 --- /dev/null +++ b/html-test/README @@ -0,0 +1,24 @@ +This is a testsuite for Haddock that uses the concept of "golden files". That +is, it compares output files against a set of reference files. + +To add a new test: + + 1) Create a module in the "tests" directory. + + 2) Run "cabal test". You should now have output/.html. The test + passes since there is no reference file to compare with. + + 3) To make a reference file from the output file, do + runhaskell accept.hs + +Tips and tricks: + +To "accept" all output files (copy them to reference files), run + runhaskell accept.hs + +You can run all tests despite failing tests, like so + cabal test --test-option=all + +You can pass extra options to haddock like so + cabal test --test-options='all --title="All Tests"' + diff --git a/html-test/accept.hs b/html-test/accept.hs new file mode 100644 index 00000000..45b32078 --- /dev/null +++ b/html-test/accept.hs @@ -0,0 +1,43 @@ +import System.Cmd +import System.Environment +import System.FilePath +import System.Exit +import System.Directory +import Data.List +import Control.Monad +import Control.Applicative + + +main = do + args <- getArgs + dir <- getCurrentDirectory + contents <- filter (`notElem` ignore) <$> getDirectoryContents (dir "output") + if not $ null args + then + mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] + else + mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file ] + where + ignore = [ + "doc-index.html" + , "index-frames.html" + , "index.html" + ] + + +copy file = do + let new = "tests" takeFileName file <.> ".ref" + print file + print new + contents <- readFile file + writeFile new (stripLinks contents) + + +stripLinks str = + let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs diff --git a/html-test/runtests.hs b/html-test/runtests.hs new file mode 100644 index 00000000..292deb8b --- /dev/null +++ b/html-test/runtests.hs @@ -0,0 +1,152 @@ +import Prelude hiding (mod) +import Control.Monad +import Control.Applicative +import Data.List +import Data.Maybe +import Distribution.InstalledPackageInfo +import Distribution.Package (PackageName (..)) +import Distribution.Simple.Compiler +import Distribution.Simple.GHC +import Distribution.Simple.PackageIndex +import Distribution.Simple.Program +import Distribution.Simple.Utils +import Distribution.Verbosity +import System.IO +import System.Cmd +import System.Directory +import System.Environment +import System.Exit +import System.FilePath +import System.Process (ProcessHandle, runProcess, waitForProcess) + + +packageRoot, dataDir, haddockPath, testSuiteRoot, testDir, outDir :: FilePath +packageRoot = "." +dataDir = packageRoot "resources" +haddockPath = packageRoot "dist" "build" "haddock" "haddock" +testSuiteRoot = packageRoot "html-test" +testDir = testSuiteRoot "tests" +outDir = testSuiteRoot "output" + + +main :: IO () +main = do + test + putStrLn "All tests passed!" + + +test :: IO () +test = do + x <- doesFileExist haddockPath + unless x $ die "you need to run 'cabal build' successfully first" + + contents <- getDirectoryContents testDir + args <- getArgs + let (opts, spec) = span ("-" `isPrefixOf`) args + let mods = + case spec of + y:_ | y /= "all" -> [y ++ ".hs"] + _ -> filter ((==) ".hs" . takeExtension) contents + + let mods' = map (testDir ) mods + + -- add haddock_datadir to environment for subprocesses + env <- Just . (:) ("haddock_datadir", dataDir) <$> getEnvironment + + putStrLn "" + putStrLn "Haddock version: " + h1 <- runProcess haddockPath ["--version"] Nothing + env Nothing Nothing Nothing + wait h1 "*** Running `haddock --version' failed!" + putStrLn "" + putStrLn "GHC version: " + h2 <- runProcess haddockPath ["--ghc-version"] Nothing + env Nothing Nothing Nothing + wait h2 "*** Running `haddock --ghc-version' failed!" + putStrLn "" + + -- TODO: maybe do something more clever here using haddock.cabal + ghcPath <- fmap init $ rawSystemStdout normal haddockPath ["--print-ghc-path"] + (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration + pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf + let mkDep pkgName = + fromMaybe (error "Couldn't find test dependencies") $ do + let pkgs = lookupPackageName pkgIndex (PackageName pkgName) + (_, pkgs') <- listToMaybe pkgs + pkg <- listToMaybe pkgs' + ifacePath <- listToMaybe (haddockInterfaces pkg) + htmlPath <- listToMaybe (haddockHTMLs pkg) + return ("-i " ++ htmlPath ++ "," ++ ifacePath) + + let base = mkDep "base" + process = mkDep "process" + ghcprim = mkDep "ghc-prim" + + putStrLn "Running tests..." + handle <- runProcess haddockPath + (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" + , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') + Nothing env Nothing + Nothing Nothing + + wait handle "*** Haddock run failed! Exiting." + check mods (if not (null args) && args !! 0 == "all" then False else True) + where + wait :: ProcessHandle -> String -> IO () + wait h msg = do + r <- waitForProcess h + unless (r == ExitSuccess) $ do + hPutStrLn stderr msg + exitFailure + +check :: [FilePath] -> Bool -> IO () +check modules strict = do + forM_ modules $ \mod -> do + let outfile = outDir dropExtension mod ++ ".html" + let reffile = testDir dropExtension mod ++ ".html.ref" + b <- doesFileExist reffile + if b + then do + copyFile reffile (outDir takeFileName reffile) + out <- readFile outfile + ref <- readFile reffile + if not $ haddockEq out ref + then do + putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" + let ref' = stripLinks ref + out' = stripLinks out + let reffile' = outDir takeFileName reffile ++ ".nolinks" + outfile' = outDir takeFileName outfile ++ ".nolinks" + writeFile reffile' ref' + writeFile outfile' out' + r <- programOnPath "colordiff" + code <- if r + then system $ "colordiff " ++ reffile' ++ " " ++ outfile' + else system $ "diff " ++ reffile' ++ " " ++ outfile' + if strict then exitFailure else return () + unless (code == ExitSuccess) $ do + hPutStrLn stderr "*** Running diff failed!" + exitFailure + else do + putStrLn $ "Pass: " ++ mod + else do + putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" + + +haddockEq :: String -> String -> Bool +haddockEq file1 file2 = stripLinks file1 == stripLinks file2 + +stripLinks :: String -> String +stripLinks str = + let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') + Nothing -> + case str of + [] -> [] + x : xs -> x : stripLinks xs + +programOnPath :: FilePath -> IO Bool +programOnPath p = do + result <- findProgramLocation silent p + return (isJust result) diff --git a/html-test/tests/A.hs b/html-test/tests/A.hs new file mode 100644 index 00000000..606b0865 --- /dev/null +++ b/html-test/tests/A.hs @@ -0,0 +1,17 @@ +module A where + +data A = A + +other :: Int +other = 2 + +-- | Doc for test2 +test2 :: Bool +test2 = False + +-- | Should show up on the page for both modules A and B +data X = X -- ^ Doc for consructor + +-- | Should show up on the page for both modules A and B +reExport :: Int +reExport = 1 diff --git a/html-test/tests/A.html.ref b/html-test/tests/A.html.ref new file mode 100644 index 00000000..328fec02 --- /dev/null +++ b/html-test/tests/A.html.ref @@ -0,0 +1,183 @@ + +A
    Safe HaskellNone

    A

    Synopsis

    Documentation

    data A

    Constructors

    A 

    test2 :: Bool

    Doc for test2 +

    data X

    Should show up on the page for both modules A and B +

    Constructors

    X

    Doc for consructor +

    reExport :: Int

    Should show up on the page for both modules A and B +

    diff --git a/html-test/tests/AdvanceTypes.hs b/html-test/tests/AdvanceTypes.hs new file mode 100644 index 00000000..939fdf07 --- /dev/null +++ b/html-test/tests/AdvanceTypes.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE TypeOperators #-} +module AdvanceTypes where + +data Pattern :: [*] -> * where + Nil :: Pattern '[] + Cons :: Maybe h -> Pattern t -> Pattern (h ': t) diff --git a/html-test/tests/AdvanceTypes.html.ref b/html-test/tests/AdvanceTypes.html.ref new file mode 100644 index 00000000..bac545be --- /dev/null +++ b/html-test/tests/AdvanceTypes.html.ref @@ -0,0 +1,97 @@ + +AdvanceTypes
    Safe HaskellNone

    AdvanceTypes

    Documentation

    data Pattern where

    Constructors

    Nil :: Pattern `[]` 
    Cons :: Maybe h -> Pattern t -> Pattern (h : t) 
    diff --git a/html-test/tests/B.hs b/html-test/tests/B.hs new file mode 100644 index 00000000..5fd69acd --- /dev/null +++ b/html-test/tests/B.hs @@ -0,0 +1,8 @@ +module B ( module A, test, reExport, X(..) ) where +import A ( A(..), test2, reExport, X(..) ) + +-- | This link shouldn't work: 'other'. +-- These links should work: 'A.other', 'Data.List.sortBy', 'test2', 'A.test2', 'Data.Maybe.fromMaybe'. +-- Module link: "Prelude". +test :: Int +test = 1 diff --git a/html-test/tests/B.html.ref b/html-test/tests/B.html.ref new file mode 100644 index 00000000..410bc75b --- /dev/null +++ b/html-test/tests/B.html.ref @@ -0,0 +1,175 @@ + +B
    Safe HaskellNone

    B

    Synopsis

    Documentation

    module A

    test :: Int

    This link shouldn't work: other. + These links should work: other, sortBy, test2, test2, fromMaybe. + Module link: Prelude. +

    reExport :: Int

    Should show up on the page for both modules A and B +

    data X

    Should show up on the page for both modules A and B +

    Constructors

    X

    Doc for consructor +

    diff --git a/html-test/tests/Bug1.hs b/html-test/tests/Bug1.hs new file mode 100644 index 00000000..af1ed4d3 --- /dev/null +++ b/html-test/tests/Bug1.hs @@ -0,0 +1,6 @@ +module Bug1 where + +-- | We should have different anchors for constructors and types\/classes. This +-- hyperlink should point to the type constructor by default: 'T'. +data T = T + diff --git a/html-test/tests/Bug1.html.ref b/html-test/tests/Bug1.html.ref new file mode 100644 index 00000000..f8a86948 --- /dev/null +++ b/html-test/tests/Bug1.html.ref @@ -0,0 +1,103 @@ + +Bug1
    Safe HaskellNone

    Bug1

    Synopsis

    • data T = T

    Documentation

    data T

    We should have different anchors for constructors and types/classes. This + hyperlink should point to the type constructor by default: T. +

    Constructors

    T 
    diff --git a/html-test/tests/Bug2.hs b/html-test/tests/Bug2.hs new file mode 100644 index 00000000..9121922e --- /dev/null +++ b/html-test/tests/Bug2.hs @@ -0,0 +1,4 @@ +module Bug2 ( x ) where +import B +x :: A +x = A diff --git a/html-test/tests/Bug2.html.ref b/html-test/tests/Bug2.html.ref new file mode 100644 index 00000000..813035a6 --- /dev/null +++ b/html-test/tests/Bug2.html.ref @@ -0,0 +1,65 @@ + +Bug2
    Safe HaskellNone

    Bug2

    Documentation

    x :: A

    diff --git a/html-test/tests/Bug3.hs b/html-test/tests/Bug3.hs new file mode 100644 index 00000000..67e57892 --- /dev/null +++ b/html-test/tests/Bug3.hs @@ -0,0 +1,6 @@ +module Bug3 where + +-- | /multi-line +-- emphasis/ +foo :: Int +foo = undefined diff --git a/html-test/tests/Bug3.html.ref b/html-test/tests/Bug3.html.ref new file mode 100644 index 00000000..76d4e730 --- /dev/null +++ b/html-test/tests/Bug3.html.ref @@ -0,0 +1,83 @@ + +Bug3
    Safe HaskellNone

    Bug3

    Synopsis

    Documentation

    foo :: Int

    /multi-line + emphasis/ +

    diff --git a/html-test/tests/Bug4.hs b/html-test/tests/Bug4.hs new file mode 100644 index 00000000..425a77aa --- /dev/null +++ b/html-test/tests/Bug4.hs @@ -0,0 +1,5 @@ +module Bug4 where +-- | don't use apostrophe's in the wrong place's +foo :: Int +foo = undefined + diff --git a/html-test/tests/Bug4.html.ref b/html-test/tests/Bug4.html.ref new file mode 100644 index 00000000..9e852978 --- /dev/null +++ b/html-test/tests/Bug4.html.ref @@ -0,0 +1,82 @@ + +Bug4
    Safe HaskellNone

    Bug4

    Synopsis

    Documentation

    foo :: Int

    don't use apostrophe's in the wrong place's +

    diff --git a/html-test/tests/Bug6.hs b/html-test/tests/Bug6.hs new file mode 100644 index 00000000..17411f31 --- /dev/null +++ b/html-test/tests/Bug6.hs @@ -0,0 +1,23 @@ +-- | Exporting records. +module Bug6( A(A), B(B), b, C(C,c1,c2), D(D,d1), E(E) ) where + +-- | +-- This record is exported without its field +data A = A { a :: Int } + +-- | +-- .. with its field, but the field is named separately in the export list +-- (the field isn't documented separately since it is already documented here) +data B = B { b :: Int } + +-- | +-- .. with fields names as subordinate names in the export +data C = C { c1 :: Int, c2 :: Int } + +-- | +-- .. with only some of the fields exported (we can't handle this one - +-- how do we render the declaration?) +data D = D { d1 :: Int, d2 :: Int } + +-- | a newtype with a field +newtype E = E { e :: Int } diff --git a/html-test/tests/Bug6.html.ref b/html-test/tests/Bug6.html.ref new file mode 100644 index 00000000..606e45e3 --- /dev/null +++ b/html-test/tests/Bug6.html.ref @@ -0,0 +1,335 @@ + +Bug6
    Safe HaskellNone

    Bug6

    Description

    Exporting records. +

    Synopsis

    Documentation

    data A

    This record is exported without its field +

    Constructors

    A Int 

    data B

    .. with its field, but the field is named separately in the export list + (the field isn't documented separately since it is already documented here) +

    Constructors

    B 

    Fields

    b :: Int
     

    data C

    .. with fields names as subordinate names in the export +

    Constructors

    C 

    Fields

    c1 :: Int
     
    c2 :: Int
     

    data D

    .. with only some of the fields exported (we can't handle this one - + how do we render the declaration?) +

    Constructors

    D Int Int 

    newtype E

    a newtype with a field +

    Constructors

    E Int 
    diff --git a/html-test/tests/Bug7.hs b/html-test/tests/Bug7.hs new file mode 100644 index 00000000..8cf57914 --- /dev/null +++ b/html-test/tests/Bug7.hs @@ -0,0 +1,12 @@ +-- | This module caused a duplicate instance in the documentation for the Foo +-- type. +module Bug7 where + +-- | The Foo datatype +data Foo = Foo + +-- | The Bar class +class Bar x y + +-- | Just one instance +instance Bar Foo Foo diff --git a/html-test/tests/Bug7.html.ref b/html-test/tests/Bug7.html.ref new file mode 100644 index 00000000..8ac72b16 --- /dev/null +++ b/html-test/tests/Bug7.html.ref @@ -0,0 +1,173 @@ + +Bug7
    Safe HaskellNone

    Bug7

    Description

    This module caused a duplicate instance in the documentation for the Foo + type. +

    Synopsis

    Documentation

    data Foo

    The Foo datatype +

    Constructors

    Foo 

    Instances

    Bar Foo Foo

    Just one instance +

    class Bar x y

    The Bar class +

    Instances

    Bar Foo Foo

    Just one instance +

    diff --git a/html-test/tests/Bug8.hs b/html-test/tests/Bug8.hs new file mode 100644 index 00000000..18df63c8 --- /dev/null +++ b/html-test/tests/Bug8.hs @@ -0,0 +1,14 @@ +module Bug8 where + +infix --> +infix ---> + +data Typ = Type (String,[Typ]) + | TFree (String, [String]) + +x --> y = Type("fun",[s,t]) +(--->) = flip $ foldr (-->) + +s = undefined +t = undefined +main = undefined diff --git a/html-test/tests/Bug8.html.ref b/html-test/tests/Bug8.html.ref new file mode 100644 index 00000000..469151f1 --- /dev/null +++ b/html-test/tests/Bug8.html.ref @@ -0,0 +1,131 @@ + +Bug8
    Safe HaskellNone

    Bug8

    Documentation

    data Typ

    Constructors

    Type (String, [Typ]) 
    TFree (String, [String]) 

    (-->) :: t -> t1 -> Typ

    (--->) :: [a] -> Typ -> Typ

    s :: a

    t :: a

    main :: a

    diff --git a/html-test/tests/BugDeprecated.hs b/html-test/tests/BugDeprecated.hs new file mode 100644 index 00000000..0f7ac2eb --- /dev/null +++ b/html-test/tests/BugDeprecated.hs @@ -0,0 +1,18 @@ +module BugDeprecated where + +foo, bar, baz :: Int +foo = 23 +bar = 23 +baz = 23 +{-# DEPRECATED foo "for foo" #-} +{-# DEPRECATED bar "for bar" #-} +{-# DEPRECATED baz "for baz" #-} + +-- | some documentation for one, two and three +one, two, three :: Int +one = 23 +two = 23 +three = 23 +{-# DEPRECATED one "for one" #-} +{-# DEPRECATED two "for two" #-} +{-# DEPRECATED three "for three" #-} diff --git a/html-test/tests/BugDeprecated.html.ref b/html-test/tests/BugDeprecated.html.ref new file mode 100644 index 00000000..913b189d --- /dev/null +++ b/html-test/tests/BugDeprecated.html.ref @@ -0,0 +1,198 @@ + +BugDeprecated
    Safe HaskellNone

    BugDeprecated

    Synopsis

    Documentation

    foo :: Int

    Deprecated: for foo +

    baz :: Int

    Deprecated: for baz +

    bar :: Int

    Deprecated: for bar +

    one :: Int

    Deprecated: for one +

    some documentation for one, two and three +

    three :: Int

    Deprecated: for three +

    some documentation for one, two and three +

    two :: Int

    Deprecated: for two +

    some documentation for one, two and three +

    diff --git a/html-test/tests/BugExportHeadings.hs b/html-test/tests/BugExportHeadings.hs new file mode 100644 index 00000000..a5493a08 --- /dev/null +++ b/html-test/tests/BugExportHeadings.hs @@ -0,0 +1,29 @@ +-- test for #192 +module BugExportHeadings ( +-- * Foo + foo +-- * Bar +, bar +-- * Baz +, baz + +-- * One +, one +-- * Two +, two +-- * Three +, three +) where + +foo, bar, baz :: Int +foo = 23 +bar = 23 +baz = 23 + +one, two, three :: Int +one = 23 +two = 23 +three = 23 +{-# DEPRECATED one "for one" #-} +{-# DEPRECATED two "for two" #-} +{-# DEPRECATED three "for three" #-} diff --git a/html-test/tests/BugExportHeadings.html.ref b/html-test/tests/BugExportHeadings.html.ref new file mode 100644 index 00000000..457e2c50 --- /dev/null +++ b/html-test/tests/BugExportHeadings.html.ref @@ -0,0 +1,220 @@ + +BugExportHeadings
    Safe HaskellNone

    BugExportHeadings

    Synopsis

    Foo +

    foo :: Int

    Bar +

    bar :: Int

    Baz +

    baz :: Int

    One +

    one :: Int

    Deprecated: for one +

    Two +

    two :: Int

    Deprecated: for two +

    Three +

    three :: Int

    Deprecated: for three +

    diff --git a/html-test/tests/Bugs.hs b/html-test/tests/Bugs.hs new file mode 100644 index 00000000..8e1f0079 --- /dev/null +++ b/html-test/tests/Bugs.hs @@ -0,0 +1,3 @@ +module Bugs where + +data A a = A a (a -> Int) diff --git a/html-test/tests/Bugs.html.ref b/html-test/tests/Bugs.html.ref new file mode 100644 index 00000000..c5a4ca9d --- /dev/null +++ b/html-test/tests/Bugs.html.ref @@ -0,0 +1,81 @@ + +Bugs
    Safe HaskellNone

    Bugs

    Documentation

    data A a

    Constructors

    A a (a -> Int) 
    diff --git a/html-test/tests/CrossPackageDocs.hs b/html-test/tests/CrossPackageDocs.hs new file mode 100644 index 00000000..4d529f79 --- /dev/null +++ b/html-test/tests/CrossPackageDocs.hs @@ -0,0 +1,4 @@ +module CrossPackageDocs (map, IsString(..), runInteractiveProcess) where + +import System.Process +import Data.String diff --git a/html-test/tests/CrossPackageDocs.html.ref b/html-test/tests/CrossPackageDocs.html.ref new file mode 100644 index 00000000..fea3d0cc --- /dev/null +++ b/html-test/tests/CrossPackageDocs.html.ref @@ -0,0 +1,298 @@ + +CrossPackageDocs
    Safe HaskellNone

    CrossPackageDocs

    Synopsis

    Documentation

    map :: (a -> b) -> [a] -> [b]

    map f xs is the list obtained by applying f to each element + of xs, i.e., +

     map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
    + map f [x1, x2, ...] == [f x1, f x2, ...]
    +

    class IsString a where

    Class for string-like datastructures; used by the overloaded string + extension (-foverloaded-strings in GHC). +

    Methods

    fromString :: String -> a

    Instances

    runInteractiveProcess

    Arguments

    :: FilePath

    Filename of the executable (see proc for details) +

    -> [String]

    Arguments to pass to the executable +

    -> Maybe FilePath

    Optional path to the working directory +

    -> Maybe [(String, String)]

    Optional environment (otherwise inherit) +

    -> IO (Handle, Handle, Handle, ProcessHandle) 

    Runs a raw command, and returns Handles that may be used to communicate + with the process via its stdin, stdout and stderr respectively. +

    For example, to start a process and feed a string to its stdin: +

       (inp,out,err,pid) <- runInteractiveProcess "..."
    +   forkIO (hPutStr inp str)
    +

    The Handles are initially in binary mode; if you need them to be + in text mode then use hSetBinaryMode. +

    diff --git a/html-test/tests/DeprecatedClass.hs b/html-test/tests/DeprecatedClass.hs new file mode 100644 index 00000000..018904ab --- /dev/null +++ b/html-test/tests/DeprecatedClass.hs @@ -0,0 +1,15 @@ +module DeprecatedClass where + +-- | some class +class SomeClass a where + -- | documentation for foo + foo :: a -> a + +{-# DEPRECATED SomeClass "SomeClass" #-} +{-# DEPRECATED foo "foo" #-} + +class SomeOtherClass a where + bar :: a -> a + +{-# DEPRECATED SomeOtherClass "SomeOtherClass" #-} +{-# DEPRECATED bar "bar" #-} diff --git a/html-test/tests/DeprecatedClass.html.ref b/html-test/tests/DeprecatedClass.html.ref new file mode 100644 index 00000000..d716c1d8 --- /dev/null +++ b/html-test/tests/DeprecatedClass.html.ref @@ -0,0 +1,161 @@ + +DeprecatedClass
    Safe HaskellNone

    DeprecatedClass

    Synopsis

    Documentation

    class SomeClass a where

    Deprecated: SomeClass +

    some class +

    Methods

    foo :: a -> a

    Deprecated: foo +

    documentation for foo +

    class SomeOtherClass a where

    Deprecated: SomeOtherClass +

    Methods

    bar :: a -> a

    Deprecated: bar +

    diff --git a/html-test/tests/DeprecatedData.hs b/html-test/tests/DeprecatedData.hs new file mode 100644 index 00000000..c40ba122 --- /dev/null +++ b/html-test/tests/DeprecatedData.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE TypeFamilies #-} +module DeprecatedData where + +-- | type Foo +data Foo = Foo -- ^ constructor Foo + | Bar -- ^ constructor Bar + +{-# DEPRECATED Foo "Foo" #-} +{-# DEPRECATED Bar "Bar" #-} + +data One = One + | Two + +{-# DEPRECATED One "One" #-} +{-# DEPRECATED Two "Two" #-} diff --git a/html-test/tests/DeprecatedData.html.ref b/html-test/tests/DeprecatedData.html.ref new file mode 100644 index 00000000..24758345 --- /dev/null +++ b/html-test/tests/DeprecatedData.html.ref @@ -0,0 +1,198 @@ + +DeprecatedData
    Safe HaskellNone

    DeprecatedData

    Synopsis

    Documentation

    data Foo

    Deprecated: Foo +

    type Foo +

    Constructors

    Foo

    Deprecated: Foo +

    constructor Foo +

    Bar

    Deprecated: Bar +

    constructor Bar +

    data One

    Deprecated: One +

    Constructors

    One

    Deprecated: One +

    Two

    Deprecated: Two +

    diff --git a/html-test/tests/DeprecatedFunction.hs b/html-test/tests/DeprecatedFunction.hs new file mode 100644 index 00000000..8d626435 --- /dev/null +++ b/html-test/tests/DeprecatedFunction.hs @@ -0,0 +1,10 @@ +module DeprecatedFunction where + +-- | some documentation for foo +foo :: Int +foo = 23 +{-# DEPRECATED foo "use `bar` instead" #-} + +-- | some documentation for bar +bar :: Int +bar = 42 diff --git a/html-test/tests/DeprecatedFunction.html.ref b/html-test/tests/DeprecatedFunction.html.ref new file mode 100644 index 00000000..1fc678bb --- /dev/null +++ b/html-test/tests/DeprecatedFunction.html.ref @@ -0,0 +1,110 @@ + +DeprecatedFunction
    Safe HaskellNone

    DeprecatedFunction

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use bar instead +

    some documentation for foo +

    bar :: Int

    some documentation for bar +

    diff --git a/html-test/tests/DeprecatedFunction2.hs b/html-test/tests/DeprecatedFunction2.hs new file mode 100644 index 00000000..bdbbf95c --- /dev/null +++ b/html-test/tests/DeprecatedFunction2.hs @@ -0,0 +1,6 @@ +module DeprecatedFunction2 where + + +foo :: Int +foo = 23 +{-# DEPRECATED foo "use bar instead" #-} diff --git a/html-test/tests/DeprecatedFunction2.html.ref b/html-test/tests/DeprecatedFunction2.html.ref new file mode 100644 index 00000000..b5068c8e --- /dev/null +++ b/html-test/tests/DeprecatedFunction2.html.ref @@ -0,0 +1,84 @@ + +DeprecatedFunction2
    Safe HaskellNone

    DeprecatedFunction2

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use bar instead +

    diff --git a/html-test/tests/DeprecatedFunction3.hs b/html-test/tests/DeprecatedFunction3.hs new file mode 100644 index 00000000..ca719bda --- /dev/null +++ b/html-test/tests/DeprecatedFunction3.hs @@ -0,0 +1,6 @@ +module DeprecatedFunction3 where + + + +foo = 23 +{-# DEPRECATED foo "use bar instead" #-} diff --git a/html-test/tests/DeprecatedFunction3.html.ref b/html-test/tests/DeprecatedFunction3.html.ref new file mode 100644 index 00000000..f24eb666 --- /dev/null +++ b/html-test/tests/DeprecatedFunction3.html.ref @@ -0,0 +1,84 @@ + +DeprecatedFunction3
    Safe HaskellNone

    DeprecatedFunction3

    Synopsis

    Documentation

    foo :: Integer

    Deprecated: use bar instead +

    diff --git a/html-test/tests/DeprecatedModule.hs b/html-test/tests/DeprecatedModule.hs new file mode 100644 index 00000000..369dba4f --- /dev/null +++ b/html-test/tests/DeprecatedModule.hs @@ -0,0 +1,5 @@ +-- | Documentation for "DeprecatedModule". +module DeprecatedModule {-# DEPRECATED "Use \"Foo\" instead" #-} where + +foo :: Int +foo = 23 diff --git a/html-test/tests/DeprecatedModule.html.ref b/html-test/tests/DeprecatedModule.html.ref new file mode 100644 index 00000000..0ca4fafe --- /dev/null +++ b/html-test/tests/DeprecatedModule.html.ref @@ -0,0 +1,83 @@ + +DeprecatedModule
    Safe HaskellNone

    DeprecatedModule

    Description

    Deprecated: Use Foo instead +

    Documentation for DeprecatedModule. +

    Documentation

    foo :: Int

    diff --git a/html-test/tests/DeprecatedModule2.hs b/html-test/tests/DeprecatedModule2.hs new file mode 100644 index 00000000..94185297 --- /dev/null +++ b/html-test/tests/DeprecatedModule2.hs @@ -0,0 +1,4 @@ +module DeprecatedModule2 {-# DEPRECATED "Use Foo instead" #-} where + +foo :: Int +foo = 23 diff --git a/html-test/tests/DeprecatedModule2.html.ref b/html-test/tests/DeprecatedModule2.html.ref new file mode 100644 index 00000000..0a313ae9 --- /dev/null +++ b/html-test/tests/DeprecatedModule2.html.ref @@ -0,0 +1,76 @@ + +DeprecatedModule2
    Safe HaskellNone

    DeprecatedModule2

    Description

    Deprecated: Use Foo instead +

    Documentation

    foo :: Int

    diff --git a/html-test/tests/DeprecatedNewtype.hs b/html-test/tests/DeprecatedNewtype.hs new file mode 100644 index 00000000..254f1f55 --- /dev/null +++ b/html-test/tests/DeprecatedNewtype.hs @@ -0,0 +1,10 @@ +module DeprecatedNewtype where + +-- | some documentation +newtype SomeNewType = SomeNewTypeConst String {- ^ constructor docu -} +{-# DEPRECATED SomeNewType "SomeNewType" #-} +{-# DEPRECATED SomeNewTypeConst "SomeNewTypeConst" #-} + +newtype SomeOtherNewType = SomeOtherNewTypeConst String +{-# DEPRECATED SomeOtherNewType "SomeOtherNewType" #-} +{-# DEPRECATED SomeOtherNewTypeConst "SomeOtherNewTypeConst" #-} diff --git a/html-test/tests/DeprecatedNewtype.html.ref b/html-test/tests/DeprecatedNewtype.html.ref new file mode 100644 index 00000000..521ffb92 --- /dev/null +++ b/html-test/tests/DeprecatedNewtype.html.ref @@ -0,0 +1,161 @@ + +DeprecatedNewtype
    Safe HaskellNone

    DeprecatedNewtype

    Documentation

    newtype SomeNewType

    Deprecated: SomeNewType +

    some documentation +

    Constructors

    SomeNewTypeConst String

    Deprecated: SomeNewTypeConst +

    constructor docu +

    newtype SomeOtherNewType

    Deprecated: SomeOtherNewType +

    Constructors

    SomeOtherNewTypeConst String

    Deprecated: SomeOtherNewTypeConst +

    diff --git a/html-test/tests/DeprecatedReExport.hs b/html-test/tests/DeprecatedReExport.hs new file mode 100644 index 00000000..f851e2ff --- /dev/null +++ b/html-test/tests/DeprecatedReExport.hs @@ -0,0 +1,16 @@ +-- | +-- What is tested here: +-- +-- * Deprecation messages are shown for re-exported items. +-- +module DeprecatedReExport ( +-- * Re-exported from an other module + foo +-- * Re-exported from an other package +-- | Not yet working, see +-- , isEmptyChan +, +) where + +import DeprecatedFunction +import Control.Concurrent.Chan diff --git a/html-test/tests/DeprecatedReExport.html.ref b/html-test/tests/DeprecatedReExport.html.ref new file mode 100644 index 00000000..611c181d --- /dev/null +++ b/html-test/tests/DeprecatedReExport.html.ref @@ -0,0 +1,133 @@ + +DeprecatedReExport
    Safe HaskellNone

    DeprecatedReExport

    Description

    What is tested here: +

    • Deprecation messages are shown for re-exported items. +

    Synopsis

    Re-exported from an other module +

    foo :: Int

    Deprecated: use bar instead +

    some documentation for foo +

    Re-exported from an other package +

    Not yet working, see http://trac.haskell.org/haddock/ticket/223 + , isEmptyChan +

    diff --git a/html-test/tests/DeprecatedRecord.hs b/html-test/tests/DeprecatedRecord.hs new file mode 100644 index 00000000..d44499e7 --- /dev/null +++ b/html-test/tests/DeprecatedRecord.hs @@ -0,0 +1,9 @@ +module DeprecatedRecord where + +-- | type Foo +data Foo = Foo { + fooName :: String -- ^ some name +, fooValue :: Int -- ^ some value +} + +{-# DEPRECATED fooValue "do not use this" #-} diff --git a/html-test/tests/DeprecatedRecord.html.ref b/html-test/tests/DeprecatedRecord.html.ref new file mode 100644 index 00000000..9ade8377 --- /dev/null +++ b/html-test/tests/DeprecatedRecord.html.ref @@ -0,0 +1,151 @@ + +DeprecatedRecord
    Safe HaskellNone

    DeprecatedRecord

    Synopsis

    Documentation

    data Foo

    type Foo +

    Constructors

    Foo 

    Fields

    fooName :: String

    some name +

    fooValue :: Int

    Deprecated: do not use this +

    some value +

    diff --git a/html-test/tests/DeprecatedTypeFamily.hs b/html-test/tests/DeprecatedTypeFamily.hs new file mode 100644 index 00000000..70473bb8 --- /dev/null +++ b/html-test/tests/DeprecatedTypeFamily.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TypeFamilies #-} +module DeprecatedTypeFamily where + +-- | some documentation +data family SomeTypeFamily k :: * -> * +{-# DEPRECATED SomeTypeFamily "SomeTypeFamily" #-} + +data family SomeOtherTypeFamily k :: * -> * +{-# DEPRECATED SomeOtherTypeFamily "SomeOtherTypeFamily" #-} diff --git a/html-test/tests/DeprecatedTypeFamily.html.ref b/html-test/tests/DeprecatedTypeFamily.html.ref new file mode 100644 index 00000000..ffc069a6 --- /dev/null +++ b/html-test/tests/DeprecatedTypeFamily.html.ref @@ -0,0 +1,108 @@ + +DeprecatedTypeFamily
    Safe HaskellNone

    DeprecatedTypeFamily

    Synopsis

    Documentation

    data family SomeTypeFamily k :: * -> *

    Deprecated: SomeTypeFamily +

    some documentation +

    data family SomeOtherTypeFamily k :: * -> *

    Deprecated: SomeOtherTypeFamily +

    diff --git a/html-test/tests/DeprecatedTypeSynonym.hs b/html-test/tests/DeprecatedTypeSynonym.hs new file mode 100644 index 00000000..34df47da --- /dev/null +++ b/html-test/tests/DeprecatedTypeSynonym.hs @@ -0,0 +1,9 @@ + +module DeprecatedTypeSynonym where + +-- | some documentation +type TypeSyn = String +{-# DEPRECATED TypeSyn "TypeSyn" #-} + +type OtherTypeSyn = String +{-# DEPRECATED OtherTypeSyn "OtherTypeSyn" #-} diff --git a/html-test/tests/DeprecatedTypeSynonym.html.ref b/html-test/tests/DeprecatedTypeSynonym.html.ref new file mode 100644 index 00000000..665dcf5d --- /dev/null +++ b/html-test/tests/DeprecatedTypeSynonym.html.ref @@ -0,0 +1,116 @@ + +DeprecatedTypeSynonym
    Safe HaskellNone

    DeprecatedTypeSynonym

    Synopsis

    Documentation

    type TypeSyn = String

    Deprecated: TypeSyn +

    some documentation +

    type OtherTypeSyn = String

    Deprecated: OtherTypeSyn +

    diff --git a/html-test/tests/DeprecationMessageParseError.hs b/html-test/tests/DeprecationMessageParseError.hs new file mode 100644 index 00000000..2f8fb492 --- /dev/null +++ b/html-test/tests/DeprecationMessageParseError.hs @@ -0,0 +1,12 @@ +-- | +-- What is tested here: +-- +-- * If parsing of a deprecation message fails, the message is included +-- verbatim. +-- +module DeprecationMessageParseError where + +-- | some documentation for foo +foo :: Int +foo = 23 +{-# DEPRECATED foo "use @bar instead" #-} diff --git a/html-test/tests/DeprecationMessageParseError.html.ref b/html-test/tests/DeprecationMessageParseError.html.ref new file mode 100644 index 00000000..75f9bf54 --- /dev/null +++ b/html-test/tests/DeprecationMessageParseError.html.ref @@ -0,0 +1,101 @@ + +DeprecationMessageParseError
    Safe HaskellNone

    DeprecationMessageParseError

    Description

    What is tested here: +

    • If parsing of a deprecation message fails, the message is included + verbatim. +

    Synopsis

    Documentation

    foo :: Int

    Deprecated: use @bar instead

    some documentation for foo +

    diff --git a/html-test/tests/Examples.hs b/html-test/tests/Examples.hs new file mode 100644 index 00000000..c8c450f1 --- /dev/null +++ b/html-test/tests/Examples.hs @@ -0,0 +1,39 @@ +module Examples where + +-- | Fibonacci number of given 'Integer'. +-- +-- Examples: +-- +-- >>> fib 5 +-- 5 +-- >>> fib 10 +-- 55 +-- +-- >>> fib 10 +-- 55 +-- +-- One more Example: +-- +-- >>> fib 5 +-- 5 +-- +-- One more Example: +-- +-- >>> fib 5 +-- 5 +-- +-- Example with an import: +-- +-- >>> import Data.Char +-- >>> isSpace 'a' +-- False +-- +-- >>> putStrLn "foo\n\nbar" +-- foo +-- +-- bar +-- +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) diff --git a/html-test/tests/Examples.html.ref b/html-test/tests/Examples.html.ref new file mode 100644 index 00000000..7ebe7770 --- /dev/null +++ b/html-test/tests/Examples.html.ref @@ -0,0 +1,179 @@ + +Examples
    Safe HaskellNone

    Examples

    Synopsis

    Documentation

    fib :: Integer -> Integer

    Fibonacci number of given Integer. +

    Examples: +

    >>> fib 5
    +5
    +>>> fib 10
    +55
    +
    >>> fib 10
    +55
    +

    One more Example: +

    >>> fib 5
    +5
    +

    One more Example: +

    >>> fib 5
    +5
    +

    Example with an import: +

    >>> import Data.Char
    +>>> isSpace 'a'
    +False
    +
    >>> putStrLn "foo\n\nbar"
    +foo
    +
    +bar
    +
    diff --git a/html-test/tests/FunArgs.hs b/html-test/tests/FunArgs.hs new file mode 100644 index 00000000..b34d84b7 --- /dev/null +++ b/html-test/tests/FunArgs.hs @@ -0,0 +1,16 @@ +module FunArgs where + +f :: forall a. Ord a + => Int -- ^ First argument + -> a -- ^ Second argument + -> Bool -- ^ Third argument + -> (a -> a) -- ^ Fourth argument + -> () -- ^ Result +f = undefined + + +g :: a -- ^ First argument + -> b -- ^ Second argument + -> c -- ^ Third argument + -> d -- ^ Result +g = undefined diff --git a/html-test/tests/FunArgs.html.ref b/html-test/tests/FunArgs.html.ref new file mode 100644 index 00000000..6c87d1e6 --- /dev/null +++ b/html-test/tests/FunArgs.html.ref @@ -0,0 +1,176 @@ + +FunArgs
    Safe HaskellNone

    FunArgs

    Documentation

    f

    Arguments

    :: forall a . Ord a 
    => Int

    First argument +

    -> a

    Second argument +

    -> Bool

    Third argument +

    -> (a -> a)

    Fourth argument +

    -> ()

    Result +

    g

    Arguments

    :: a

    First argument +

    -> b

    Second argument +

    -> c

    Third argument +

    -> d

    Result +

    diff --git a/html-test/tests/GADTRecords.hs b/html-test/tests/GADTRecords.hs new file mode 100644 index 00000000..c77810ad --- /dev/null +++ b/html-test/tests/GADTRecords.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE GADTs #-} +module GADTRecords (H1(..)) where + +-- | h1 +data H1 a b where + C1 :: H1 a b + C2 :: Ord a => [a] -> H1 a a + C3 { field :: Int -- ^ hello docs + } :: H1 Int Int + C4 { field2 :: a -- ^ hello2 docs + } :: H1 Int a + diff --git a/html-test/tests/GADTRecords.html.ref b/html-test/tests/GADTRecords.html.ref new file mode 100644 index 00000000..e3fcd2fe --- /dev/null +++ b/html-test/tests/GADTRecords.html.ref @@ -0,0 +1,234 @@ + +GADTRecords
    Safe HaskellNone

    GADTRecords

    Synopsis

    Documentation

    data H1 a b where

    h1 +

    Constructors

    C1 :: H1 a b 
    C2 :: Ord a => [a] -> H1 a a 
    C3 :: Int -> H1 Int Int 

    Fields

    field :: Int

    hello docs +

    C4 :: a -> H1 Int a 

    Fields

    field2 :: a

    hello2 docs +

    diff --git a/html-test/tests/Hash.hs b/html-test/tests/Hash.hs new file mode 100644 index 00000000..343b69e9 --- /dev/null +++ b/html-test/tests/Hash.hs @@ -0,0 +1,51 @@ +{- | + Implementation of fixed-size hash tables, with a type + class for constructing hash values for structured types. +-} +module Hash ( + -- * The @HashTable@ type + HashTable, + + -- ** Operations on @HashTable@s + new, insert, lookup, + + -- * The @Hash@ class + Hash(..), + ) where + +import Data.Array +import Prelude hiding (lookup) + +-- | A hash table with keys of type @key@ and values of type @val@. +-- The type @key@ should be an instance of 'Eq'. +data HashTable key val = HashTable Int (Array Int [(key,val)]) + +-- | Builds a new hash table with a given size +new :: (Eq key, Hash key) => Int -> IO (HashTable key val) +new = undefined + +-- | Inserts a new element into the hash table +insert :: (Eq key, Hash key) => key -> val -> IO () +insert = undefined + +-- | Looks up a key in the hash table, returns @'Just' val@ if the key +-- was found, or 'Nothing' otherwise. +lookup :: Hash key => key -> IO (Maybe val) +lookup = undefined + +-- | A class of types which can be hashed. +class Hash a where + -- | hashes the value of type @a@ into an 'Int' + hash :: a -> Int + +instance Hash Int where + hash = id + +instance Hash Float where + hash = trunc + +instance (Hash a, Hash b) => Hash (a,b) where + hash (a,b) = hash a `xor` hash b + +trunc = undefined +xor = undefined diff --git a/html-test/tests/Hash.html.ref b/html-test/tests/Hash.html.ref new file mode 100644 index 00000000..b0cd183c --- /dev/null +++ b/html-test/tests/Hash.html.ref @@ -0,0 +1,337 @@ + +Hash
    Safe HaskellNone

    Hash

    Description

    Implementation of fixed-size hash tables, with a type + class for constructing hash values for structured types. +

    Synopsis

    The HashTable type +

    data HashTable key val

    A hash table with keys of type key and values of type val. + The type key should be an instance of Eq. +

    Operations on HashTables +

    new :: (Eq key, Hash key) => Int -> IO (HashTable key val)

    Builds a new hash table with a given size +

    insert :: (Eq key, Hash key) => key -> val -> IO ()

    Inserts a new element into the hash table +

    lookup :: Hash key => key -> IO (Maybe val)

    Looks up a key in the hash table, returns Just val if the key + was found, or Nothing otherwise. +

    The Hash class +

    class Hash a where

    A class of types which can be hashed. +

    Methods

    hash :: a -> Int

    hashes the value of type a into an Int +

    Instances

    Hash Float 
    Hash Int 
    (Hash a, Hash b) => Hash (a, b) 
    diff --git a/html-test/tests/Hidden.hs b/html-test/tests/Hidden.hs new file mode 100644 index 00000000..896da648 --- /dev/null +++ b/html-test/tests/Hidden.hs @@ -0,0 +1,6 @@ +{-# OPTIONS_HADDOCK hide #-} + +module Hidden where + +hidden :: Int -> Int +hidden a = a diff --git a/html-test/tests/HiddenInstances.hs b/html-test/tests/HiddenInstances.hs new file mode 100644 index 00000000..99a6c2fd --- /dev/null +++ b/html-test/tests/HiddenInstances.hs @@ -0,0 +1,35 @@ +-- http://trac.haskell.org/haddock/ticket/37 +module HiddenInstances (VisibleClass, VisibleData) where + +-- | Should be visible +class VisibleClass a + +-- | Should *not* be visible +class HiddenClass a + +-- | Should *not* be visible +data HiddenData = HiddenData + +-- | Should be visible +data VisibleData = VisibleData + +-- | Should be visible +instance VisibleClass Int + +-- | Should be visible +instance VisibleClass VisibleData + +-- | Should be visible +instance Num VisibleData + +-- | Should *not* be visible +instance VisibleClass HiddenData + +-- | Should *not* be visible +instance HiddenClass Int + +-- | Should *not* be visible +instance HiddenClass VisibleData + +-- | Should *not* be visible +instance HiddenClass HiddenData diff --git a/html-test/tests/HiddenInstances.html.ref b/html-test/tests/HiddenInstances.html.ref new file mode 100644 index 00000000..999c114d --- /dev/null +++ b/html-test/tests/HiddenInstances.html.ref @@ -0,0 +1,169 @@ + +HiddenInstances
    Safe HaskellNone

    HiddenInstances

    Synopsis

    Documentation

    class VisibleClass a

    Should be visible +

    Instances

    VisibleClass Int

    Should be visible +

    VisibleClass VisibleData

    Should be visible +

    data VisibleData

    Should be visible +

    Instances

    Num VisibleData

    Should be visible +

    VisibleClass VisibleData

    Should be visible +

    diff --git a/html-test/tests/HiddenInstancesA.hs b/html-test/tests/HiddenInstancesA.hs new file mode 100644 index 00000000..f1775208 --- /dev/null +++ b/html-test/tests/HiddenInstancesA.hs @@ -0,0 +1,17 @@ +{-# OPTIONS_HADDOCK hide #-} +module HiddenInstancesA where + +-- | Should be visible +class Foo a + +-- | Should be visible +data Bar + +-- | Should be visible +instance Foo Bar + +-- | Should *not* be visible +data Baz + +-- | Should *not* be visible +instance Foo Baz diff --git a/html-test/tests/HiddenInstancesB.hs b/html-test/tests/HiddenInstancesB.hs new file mode 100644 index 00000000..eabf0637 --- /dev/null +++ b/html-test/tests/HiddenInstancesB.hs @@ -0,0 +1,2 @@ +module HiddenInstancesB (Foo, Bar) where +import HiddenInstancesA diff --git a/html-test/tests/HiddenInstancesB.html.ref b/html-test/tests/HiddenInstancesB.html.ref new file mode 100644 index 00000000..207a5146 --- /dev/null +++ b/html-test/tests/HiddenInstancesB.html.ref @@ -0,0 +1,143 @@ + +HiddenInstancesB
    Safe HaskellNone

    HiddenInstancesB

    Synopsis

    Documentation

    class Foo a

    Should be visible +

    Instances

    Foo Bar

    Should be visible +

    data Bar

    Should be visible +

    Instances

    Foo Bar

    Should be visible +

    diff --git a/html-test/tests/Hyperlinks.hs b/html-test/tests/Hyperlinks.hs new file mode 100644 index 00000000..34e64448 --- /dev/null +++ b/html-test/tests/Hyperlinks.hs @@ -0,0 +1,8 @@ +module Hyperlinks where + +-- | +-- A plain URL: +-- +-- A URL with a label: +foo :: Int +foo = 23 diff --git a/html-test/tests/Hyperlinks.html.ref b/html-test/tests/Hyperlinks.html.ref new file mode 100644 index 00000000..e7351a63 --- /dev/null +++ b/html-test/tests/Hyperlinks.html.ref @@ -0,0 +1,89 @@ + +Hyperlinks
    Safe HaskellNone

    Hyperlinks

    Synopsis

    Documentation

    foo :: Int

    A plain URL: http://example.com/ +

    A URL with a label: some link +

    diff --git a/html-test/tests/IgnoreExports.hs b/html-test/tests/IgnoreExports.hs new file mode 100644 index 00000000..0321ad02 --- /dev/null +++ b/html-test/tests/IgnoreExports.hs @@ -0,0 +1,10 @@ +{-# OPTIONS_HADDOCK ignore-exports #-} +module IgnoreExports (foo) where + +-- | documentation for foo +foo :: Int +foo = 23 + +-- | documentation for bar +bar :: Int +bar = 23 diff --git a/html-test/tests/IgnoreExports.html.ref b/html-test/tests/IgnoreExports.html.ref new file mode 100644 index 00000000..c661b48c --- /dev/null +++ b/html-test/tests/IgnoreExports.html.ref @@ -0,0 +1,101 @@ + +IgnoreExports
    Safe HaskellNone

    IgnoreExports

    Synopsis

    Documentation

    foo :: Int

    documentation for foo +

    bar :: Int

    documentation for bar +

    diff --git a/html-test/tests/ModuleWithWarning.hs b/html-test/tests/ModuleWithWarning.hs new file mode 100644 index 00000000..e64d9d7e --- /dev/null +++ b/html-test/tests/ModuleWithWarning.hs @@ -0,0 +1,5 @@ +-- | Documentation for "ModuleWithWarning". +module ModuleWithWarning {-# WARNING "This is an unstable interface. Prefer functions from \"Prelude\" instead!" #-} where + +foo :: Int +foo = 23 diff --git a/html-test/tests/ModuleWithWarning.html.ref b/html-test/tests/ModuleWithWarning.html.ref new file mode 100644 index 00000000..348f0822 --- /dev/null +++ b/html-test/tests/ModuleWithWarning.html.ref @@ -0,0 +1,83 @@ + +ModuleWithWarning
    Safe HaskellNone

    ModuleWithWarning

    Description

    Warning: This is an unstable interface. Prefer functions from Prelude instead! +

    Documentation for ModuleWithWarning. +

    Documentation

    foo :: Int

    diff --git a/html-test/tests/NamedDoc.hs b/html-test/tests/NamedDoc.hs new file mode 100644 index 00000000..7c04ba72 --- /dev/null +++ b/html-test/tests/NamedDoc.hs @@ -0,0 +1,4 @@ +module NamedDoc where + +-- $foo bar + diff --git a/html-test/tests/NamedDoc.html.ref b/html-test/tests/NamedDoc.html.ref new file mode 100644 index 00000000..d2b8ede1 --- /dev/null +++ b/html-test/tests/NamedDoc.html.ref @@ -0,0 +1,68 @@ + +NamedDoc
    Safe HaskellNone

    NamedDoc

    Synopsis

      Documentation

      bar +

      diff --git a/html-test/tests/NoLayout.hs b/html-test/tests/NoLayout.hs new file mode 100644 index 00000000..19b38b1d --- /dev/null +++ b/html-test/tests/NoLayout.hs @@ -0,0 +1,12 @@ + +-- Haddock comments are parsed as separate declarations so we +-- need to insert a ';' when using them with explicit layout. +-- This should probably be changed. + +module NoLayout where { + -- | the function 'g' + ; + g :: Int; + g = undefined + } + diff --git a/html-test/tests/NoLayout.html.ref b/html-test/tests/NoLayout.html.ref new file mode 100644 index 00000000..871add05 --- /dev/null +++ b/html-test/tests/NoLayout.html.ref @@ -0,0 +1,86 @@ + +NoLayout
      Safe HaskellNone

      NoLayout

      Synopsis

      Documentation

      g :: Int

      the function g +

      diff --git a/html-test/tests/NonGreedy.hs b/html-test/tests/NonGreedy.hs new file mode 100644 index 00000000..f51b55f5 --- /dev/null +++ b/html-test/tests/NonGreedy.hs @@ -0,0 +1,5 @@ +module NonGreedy where + +-- | +f :: a +f = undefined diff --git a/html-test/tests/NonGreedy.html.ref b/html-test/tests/NonGreedy.html.ref new file mode 100644 index 00000000..23d3f695 --- /dev/null +++ b/html-test/tests/NonGreedy.html.ref @@ -0,0 +1,82 @@ + +NonGreedy
      Safe HaskellNone

      NonGreedy

      Synopsis

      • f :: a

      Documentation

      f :: a

      diff --git a/html-test/tests/Properties.hs b/html-test/tests/Properties.hs new file mode 100644 index 00000000..05930ece --- /dev/null +++ b/html-test/tests/Properties.hs @@ -0,0 +1,9 @@ +module Properties where + +-- | Fibonacci number of given 'Integer'. +-- +-- prop> fib n <= fib (n + 1) +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) diff --git a/html-test/tests/Properties.html.ref b/html-test/tests/Properties.html.ref new file mode 100644 index 00000000..1c4ce893 --- /dev/null +++ b/html-test/tests/Properties.html.ref @@ -0,0 +1,92 @@ + +Properties
      Safe HaskellNone

      Properties

      Synopsis

      Documentation

      fib :: Integer -> Integer

      Fibonacci number of given Integer. +

      fib n <= fib (n + 1)
      diff --git a/html-test/tests/PruneWithWarning.hs b/html-test/tests/PruneWithWarning.hs new file mode 100644 index 00000000..bfa55ea2 --- /dev/null +++ b/html-test/tests/PruneWithWarning.hs @@ -0,0 +1,15 @@ +{-# OPTIONS_HADDOCK prune #-} +-- | +-- What is tested here: +-- +-- * If a binding has a deprecation message but no documentation, it is pruned +-- when @OPTIONS_HADDOCK prune@ is used. +-- +module PruneWithWarning (foo, bar) where + +foo :: Int +foo = 23 +{-# DEPRECATED foo "use bar instead" #-} + +bar :: Int +bar = 42 diff --git a/html-test/tests/PruneWithWarning.html.ref b/html-test/tests/PruneWithWarning.html.ref new file mode 100644 index 00000000..3c31fbdf --- /dev/null +++ b/html-test/tests/PruneWithWarning.html.ref @@ -0,0 +1,72 @@ + +PruneWithWarning
      Safe HaskellNone

      PruneWithWarning

      Description

      What is tested here: +

      • If a binding has a deprecation message but no documentation, it is pruned + when OPTIONS_HADDOCK prune is used. +
      diff --git a/html-test/tests/QuasiExpr.hs b/html-test/tests/QuasiExpr.hs new file mode 100644 index 00000000..970759ba --- /dev/null +++ b/html-test/tests/QuasiExpr.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE TemplateHaskell #-} + +-- Used by QuasiQuote. Example taken from the GHC documentation. +module QuasiExpr where + +import Language.Haskell.TH +import Language.Haskell.TH.Quote + +data Expr = IntExpr Integer + | AntiIntExpr String + | BinopExpr BinOp Expr Expr + | AntiExpr String + deriving Show + +data BinOp = AddOp + | SubOp + | MulOp + | DivOp + deriving Show + +eval :: Expr -> Integer +eval (IntExpr n) = n +eval (BinopExpr op x y) = (opToFun op) (eval x) (eval y) + where + opToFun AddOp = (+) + opToFun SubOp = (-) + opToFun MulOp = (*) + opToFun DivOp = div + +expr = QuasiQuoter parseExprExp undefined undefined undefined + +-- cheating... +parseExprExp :: String -> Q Exp +parseExprExp _ = [| BinopExpr AddOp (IntExpr 1) (IntExpr 2) |] diff --git a/html-test/tests/QuasiExpr.html.ref b/html-test/tests/QuasiExpr.html.ref new file mode 100644 index 00000000..0a699f35 --- /dev/null +++ b/html-test/tests/QuasiExpr.html.ref @@ -0,0 +1,221 @@ + +QuasiExpr
      Safe HaskellNone

      QuasiExpr

      Documentation

      data BinOp

      Constructors

      AddOp 
      SubOp 
      MulOp 
      DivOp 

      Instances

      expr :: QuasiQuoter

      parseExprExp :: String -> Q Exp

      diff --git a/html-test/tests/QuasiQuote.hs b/html-test/tests/QuasiQuote.hs new file mode 100644 index 00000000..06762cf9 --- /dev/null +++ b/html-test/tests/QuasiQuote.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} + +-- example taken from the GHC documentation +module QuasiQuote where + +import QuasiExpr + +val :: Integer +val = eval [expr|1 + 2|] diff --git a/html-test/tests/QuasiQuote.html.ref b/html-test/tests/QuasiQuote.html.ref new file mode 100644 index 00000000..f61f2b84 --- /dev/null +++ b/html-test/tests/QuasiQuote.html.ref @@ -0,0 +1,65 @@ + +QuasiQuote
      Safe HaskellNone

      QuasiQuote

      Documentation

      diff --git a/html-test/tests/TH.hs b/html-test/tests/TH.hs new file mode 100644 index 00000000..f8178bcb --- /dev/null +++ b/html-test/tests/TH.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TemplateHaskell #-} + +module TH where + +import Language.Haskell.TH + +decl :: Q [Dec] +decl = [d| f x = x|] diff --git a/html-test/tests/TH.html.ref b/html-test/tests/TH.html.ref new file mode 100644 index 00000000..086d6a4a --- /dev/null +++ b/html-test/tests/TH.html.ref @@ -0,0 +1,63 @@ + +TH
      Safe HaskellNone

      TH

      Documentation

      decl :: Q [Dec]

      diff --git a/html-test/tests/TH2.hs b/html-test/tests/TH2.hs new file mode 100644 index 00000000..ea85e547 --- /dev/null +++ b/html-test/tests/TH2.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TemplateHaskell #-} + +module TH2 where + +import TH + +$( decl ) diff --git a/html-test/tests/TH2.html.ref b/html-test/tests/TH2.html.ref new file mode 100644 index 00000000..4d4a8914 --- /dev/null +++ b/html-test/tests/TH2.html.ref @@ -0,0 +1,63 @@ + +TH2
      Safe HaskellNone

      TH2

      Documentation

      f :: t -> t

      diff --git a/html-test/tests/Test.hs b/html-test/tests/Test.hs new file mode 100644 index 00000000..d352f029 --- /dev/null +++ b/html-test/tests/Test.hs @@ -0,0 +1,422 @@ +----------------------------------------------------------------------------- +-- | +-- Module : Test +-- Copyright : (c) Simon Marlow 2002 +-- License : BSD-style +-- +-- Maintainer : libraries@haskell.org +-- Stability : provisional +-- Portability : portable +-- +-- This module illustrates & tests most of the features of Haddock. +-- Testing references from the description: 'T', 'f', 'g', 'Visible.visible'. +-- +----------------------------------------------------------------------------- + +-- This is plain comment, ignored by Haddock. + +module Test ( + + -- Section headings are introduced with '-- *': + -- * Type declarations + + -- Subsection headings are introduced with '-- **' and so on. + -- ** Data types + T(..), T2, T3(..), T4(..), T5(..), T6(..), + N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..), + + -- ** Records + R(..), R1(..), + + -- | test that we can export record selectors on their own: + p, q, u, + + -- * Class declarations + C(a,b), D(..), E, F(..), + + -- | Test that we can export a class method on its own: + a, + + -- * Function types + f, g, + + -- * Auxiliary stuff + + -- $aux1 + + -- $aux2 + + -- $aux3 + + -- $aux4 + + -- $aux5 + + -- $aux6 + + -- $aux7 + + -- $aux8 + + -- $aux9 + + -- $aux10 + + -- $aux11 + + -- $aux12 + + -- | This is some inline documentation in the export list + -- + -- > a code block using bird-tracks + -- > each line must begin with > (which isn't significant unless it + -- > is at the beginning of the line). + + -- * A hidden module + module Hidden, + + -- * A visible module + module Visible, + + {-| nested-style doc comments -} + + -- * Existential \/ Universal types + Ex(..), + + -- * Type signatures with argument docs + k, l, m, o, + + -- * A section + -- and without an intervening comma: + -- ** A subsection + +{-| + > a literal line + + $ a non /literal/ line $ +-} + + f', + + withType, withoutType + ) where + +import Hidden +import Visible +import Data.Maybe + +bla = Nothing + +-- | This comment applies to the /following/ declaration +-- and it continues until the next non-comment line +data T a b + = A Int (Maybe Float) -- ^ This comment describes the 'A' constructor + | -- | This comment describes the 'B' constructor + B (T a b, T Int Float) -- ^ + +-- | An abstract data declaration +data T2 a b = T2 a b + +-- | A data declaration with no documentation annotations on the constructors +data T3 a b = A1 a | B1 b + +-- A data declaration with no documentation annotations at all +data T4 a b = A2 a | B2 b + +-- A data declaration documentation on the constructors only +data T5 a b + = A3 a -- ^ documents 'A3' + | B3 b -- ^ documents 'B3' + +-- | Testing alternative comment styles +data T6 + -- | This is the doc for 'A4' + = A4 + | B4 + | -- ^ This is the doc for 'B4' + + -- | This is the doc for 'C4' + C4 + +-- | A newtype +newtype N1 a = N1 a + +-- | A newtype with a fieldname +newtype N2 a b = N2 {n :: a b} + +-- | A newtype with a fieldname, documentation on the field +newtype N3 a b = N3 {n3 :: a b -- ^ this is the 'n3' field + } + +-- | An abstract newtype - we show this one as data rather than newtype because +-- the difference isn\'t visible to the programmer for an abstract type. +newtype N4 a b = N4 a + +newtype N5 a b = N5 {n5 :: a b -- ^ no docs on the datatype or the constructor + } + +newtype N6 a b = N6 {n6 :: a b + } + -- ^ docs on the constructor only + +-- | docs on the newtype and the constructor +newtype N7 a b = N7 {n7 :: a b + } + -- ^ The 'N7' constructor + + +class (D a) => C a where + -- |this is a description of the 'a' method + a :: IO a + b :: [a] + -- ^ this is a description of the 'b' method + c :: a -- c is hidden in the export list + +-- ^ This comment applies to the /previous/ declaration (the 'C' class) + +class D a where + d :: T a b + e :: (a,a) +-- ^ This is a class declaration with no separate docs for the methods + +instance D Int where + d = undefined + e = undefined + +-- instance with a qualified class name +instance Test.D Float where + d = undefined + e = undefined + +class E a where + ee :: a +-- ^ This is a class declaration with no methods (or no methods exported) + +-- This is a class declaration with no documentation at all +class F a where + ff :: a + +-- | This is the documentation for the 'R' record, which has four fields, +-- 'p', 'q', 'r', and 's'. +data R = + -- | This is the 'C1' record constructor, with the following fields: + C1 { p :: Int -- ^ This comment applies to the 'p' field + , q :: forall a . a->a -- ^ This comment applies to the 'q' field + , -- | This comment applies to both 'r' and 's' + r,s :: Int + } + | C2 { t :: T1 -> (T2 Int Int)-> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (), + u,v :: Int + } + -- ^ This is the 'C2' record constructor, also with some fields: + +-- | Testing different record commenting styles +data R1 + -- | This is the 'C3' record constructor + = C3 { + -- | The 's1' record selector + s1 :: Int + -- | The 's2' record selector + , s2 :: Int + , s3 :: Int -- NOTE: In the original examples/Test.hs in Haddock, there is an extra "," here. + -- Since GHC doesn't allow that, I have removed it in this file. + -- ^ The 's3' record selector + } + +-- These section headers are only used when there is no export list to +-- give the structure of the documentation: + +-- * This is a section header (level 1) +-- ** This is a section header (level 2) +-- *** This is a section header (level 3) + +{-| +In a comment string we can refer to identifiers in scope with +single quotes like this: 'T', and we can refer to modules by +using double quotes: "Foo". We can add emphasis /like this/. + + * This is a bulleted list + + - This is the next item (different kind of bullet) + + (1) This is an ordered list + + 2. This is the next item (different kind of bullet) + + [cat] a small, furry, domesticated mammal + + [pineapple] a fruit grown in the tropics + +@ + This is a block of code, which can include other markup: 'R' + formatting + is + significant +@ + +> this is another block of code + +We can also include URLs in documentation: . +-} + +f :: C a => a -> Int + +-- | we can export foreign declarations too +foreign import ccall g :: Int -> IO CInt + +-- | this doc string has a parse error in it: \' +h :: Int +h = 42 + + +-- $aux1 This is some documentation that is attached to a name ($aux1) +-- rather than a source declaration. The documentation may be +-- referred to in the export list using its name. +-- +-- @ code block in named doc @ + +-- $aux2 This is some documentation that is attached to a name ($aux2) + +-- $aux3 +-- @ code block on its own in named doc @ + +-- $aux4 +-- +-- @ code block on its own in named doc (after newline) @ + +{- $aux5 a nested, named doc comment + + with a paragraph, + + @ and a code block @ +-} + +-- some tests for various arrangements of code blocks: + +{- $aux6 +>test +>test1 + +@ test2 + test3 +@ +-} + +{- $aux7 +@ +test1 +test2 +@ +-} + +{- $aux8 +>test3 +>test4 +-} + +{- $aux9 +@ +test1 +test2 +@ + +>test3 +>test4 +-} + +{- $aux10 +>test3 +>test4 + +@ +test1 +test2 +@ +-} + +-- This one is currently wrong (Haddock 0.4). The @...@ part is +-- interpreted as part of the bird-tracked code block. +{- $aux11 +aux11: + +>test3 +>test4 + +@ +test1 +test2 +@ +-} + +-- $aux12 +-- > foo +-- +-- > bar +-- + +-- | A data-type using existential\/universal types +data Ex a + = forall b . C b => Ex1 b + | forall b . Ex2 b + | forall b . C a => Ex3 b -- NOTE: I have added "forall b" here make GHC accept this file + | Ex4 (forall a . a -> a) + +-- | This is a function with documentation for each argument +k :: T () () -- ^ This argument has type 'T' + -> (T2 Int Int) -- ^ This argument has type 'T2 Int Int' + -> (T3 Bool Bool -> T4 Float Float) -- ^ This argument has type @T3 Bool Bool -> T4 Float Float@ + -> T5 () () -- ^ This argument has a very long description that should + -- hopefully cause some wrapping to happen when it is finally + -- rendered by Haddock in the generated HTML page. + -> IO () -- ^ This is the result type + +-- This function has arg docs but no docs for the function itself +l :: (Int, Int, Float) -- ^ takes a triple + -> Int -- ^ returns an 'Int' + +-- | This function has some arg docs +m :: R + -> N1 () -- ^ one of the arguments + -> IO Int -- ^ and the return value + +-- | This function has some arg docs but not a return value doc + +-- can't use the original name ('n') with GHC +newn :: R -- ^ one of the arguments, an 'R' + -> N1 () -- ^ one of the arguments + -> IO Int +newn = undefined + + +-- | A foreign import with argument docs +foreign import ccall unsafe + o :: Float -- ^ The input float + -> IO Float -- ^ The output float + +-- | We should be able to escape this: \#\#\# + +-- p :: Int +-- can't use the above original definition with GHC +newp :: Int +newp = undefined + +-- | a function with a prime can be referred to as 'f'' +-- but f' doesn't get link'd 'f\'' +f' :: Int + +-- | Comment on a definition without type signature +withoutType = undefined + +-- | Comment on a definition with type signature +withType :: Int +withType = 1 + +-- Add some definitions here so that this file can be compiled with GHC + +data T1 +f = undefined +f' = undefined +type CInt = Int +k = undefined +l = undefined +m = undefined diff --git a/html-test/tests/Test.html.ref b/html-test/tests/Test.html.ref new file mode 100644 index 00000000..f2ef2b28 --- /dev/null +++ b/html-test/tests/Test.html.ref @@ -0,0 +1,2245 @@ + +Test
      Portabilityportable
      Stabilityprovisional
      Maintainerlibraries@haskell.org
      Safe HaskellNone

      Test

      Description

      This module illustrates & tests most of the features of Haddock. + Testing references from the description: T, f, g, visible. +

      Synopsis

      Type declarations +

      Data types +

      data T a b

      This comment applies to the following declaration + and it continues until the next non-comment line +

      Constructors

      A Int (Maybe Float)

      This comment describes the A constructor +

      B (T a b, T Int Float)

      This comment describes the B constructor +

      data T2 a b

      An abstract data declaration +

      data T3 a b

      A data declaration with no documentation annotations on the constructors +

      Constructors

      A1 a 
      B1 b 

      data T4 a b

      Constructors

      A2 a 
      B2 b 

      data T5 a b

      Constructors

      A3 a

      documents A3 +

      B3 b

      documents B3 +

      data T6

      Testing alternative comment styles +

      Constructors

      A4

      This is the doc for A4 +

      B4

      This is the doc for B4 +

      C4

      This is the doc for C4 +

      newtype N1 a

      A newtype +

      Constructors

      N1 a 

      newtype N2 a b

      A newtype with a fieldname +

      Constructors

      N2 

      Fields

      n :: a b
       

      newtype N3 a b

      A newtype with a fieldname, documentation on the field +

      Constructors

      N3 

      Fields

      n3 :: a b

      this is the n3 field +

      data N4 a b

      An abstract newtype - we show this one as data rather than newtype because + the difference isn't visible to the programmer for an abstract type. +

      newtype N5 a b

      Constructors

      N5 

      Fields

      n5 :: a b

      no docs on the datatype or the constructor +

      newtype N6 a b

      Constructors

      N6

      docs on the constructor only +

      Fields

      n6 :: a b
       

      newtype N7 a b

      docs on the newtype and the constructor +

      Constructors

      N7

      The N7 constructor +

      Fields

      n7 :: a b
       

      Records +

      data R

      This is the documentation for the R record, which has four fields, + p, q, r, and s. +

      Constructors

      C1

      This is the C1 record constructor, with the following fields: +

      Fields

      p :: Int

      This comment applies to the p field +

      q :: forall a. a -> a

      This comment applies to the q field +

      r :: Int

      This comment applies to both r and s +

      s :: Int

      This comment applies to both r and s +

      C2

      This is the C2 record constructor, also with some fields: +

      Fields

      t :: T1 -> T2 Int Int -> T3 Bool Bool -> T4 Float Float -> T5 () ()
       
      u :: Int
       
      v :: Int
       

      data R1

      Testing different record commenting styles +

      Constructors

      C3

      This is the C3 record constructor +

      Fields

      s1 :: Int

      The s1 record selector +

      s2 :: Int

      The s2 record selector +

      s3 :: Int

      The s3 record selector +

      test that we can export record selectors on their own: +

      Class declarations +

      class D a => C a where

      This comment applies to the previous declaration (the C class) +

      Methods

      a :: IO a

      this is a description of the a method +

      b :: [a]

      this is a description of the b method +

      class D a where

      This is a class declaration with no separate docs for the methods +

      Methods

      d :: T a b

      e :: (a, a)

      Instances

      class E a

      This is a class declaration with no methods (or no methods exported) +

      class F a where

      Methods

      ff :: a

      Test that we can export a class method on its own: +

      Function types +

      f :: C a => a -> Int

      In a comment string we can refer to identifiers in scope with +single quotes like this: T, and we can refer to modules by +using double quotes: Foo. We can add emphasis like this. +

      • This is a bulleted list +
      • This is the next item (different kind of bullet) +
      1. This is an ordered list +
      2. This is the next item (different kind of bullet) +
      cat
      a small, furry, domesticated mammal +
      pineapple
      a fruit grown in the tropics +
      +     This is a block of code, which can include other markup: R
      +     formatting
      +               is
      +                 significant
      +
       this is another block of code
      +

      We can also include URLs in documentation: http://www.haskell.org/. +

      g :: Int -> IO CInt

      we can export foreign declarations too +

      Auxiliary stuff +

      This is some documentation that is attached to a name ($aux1) + rather than a source declaration. The documentation may be + referred to in the export list using its name. +

       code block in named doc

      This is some documentation that is attached to a name ($aux2) +

       code block on its own in named doc
       code block on its own in named doc (after newline)

      a nested, named doc comment +

      with a paragraph, +

       and a code block
      test
      +test1
      +
       test2
      +  test3
      +
      +test1
      +test2
      +
      test3
      +test4
      +
      +test1
      +test2
      +
      test3
      +test4
      +
      test3
      +test4
      +
      +test1
      +test2
      +

      aux11: +

      test3
      +test4
      +
      +test1
      +test2
      +
       foo
      +
       bar
      +

      This is some inline documentation in the export list +

       a code block using bird-tracks
      + each line must begin with > (which isn't significant unless it
      + is at the beginning of the line).
      +

      A hidden module +

      hidden :: Int -> Int

      A visible module +

      module Visible

      nested-style doc comments +

      Existential / Universal types +

      data Ex a

      A data-type using existential/universal types +

      Constructors

      forall b . C b => Ex1 b 
      forall b . Ex2 b 
      forall b . C a => Ex3 b 
      Ex4 (forall a. a -> a) 

      Type signatures with argument docs +

      k

      Arguments

      :: T () ()

      This argument has type T +

      -> T2 Int Int

      This argument has type 'T2 Int Int' +

      -> (T3 Bool Bool -> T4 Float Float)

      This argument has type T3 Bool Bool -> T4 Float Float +

      -> T5 () ()

      This argument has a very long description that should + hopefully cause some wrapping to happen when it is finally + rendered by Haddock in the generated HTML page. +

      -> IO ()

      This is the result type +

      This is a function with documentation for each argument +

      l

      Arguments

      :: (Int, Int, Float)

      takes a triple +

      -> Int

      returns an Int +

      m

      Arguments

      :: R 
      -> N1 ()

      one of the arguments +

      -> IO Int

      and the return value +

      This function has some arg docs +

      o

      Arguments

      :: Float

      The input float +

      -> IO Float

      The output float +

      A foreign import with argument docs +

      A section +

      A subsection +

       a literal line
      +

      $ a non literal line $ +

      f' :: Int

      a function with a prime can be referred to as f' + but f' doesn't get link'd 'f\'' +

      withType :: Int

      Comment on a definition with type signature +

      withoutType :: a

      Comment on a definition without type signature +

      diff --git a/html-test/tests/Ticket112.hs b/html-test/tests/Ticket112.hs new file mode 100644 index 00000000..c9cd5117 --- /dev/null +++ b/html-test/tests/Ticket112.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE MagicHash #-} + +module Ticket112 where + +import GHC.Prim + +-- | ...given a raw 'Addr#' to the string, and the length of the string. +f :: a +f = undefined diff --git a/html-test/tests/Ticket112.html.ref b/html-test/tests/Ticket112.html.ref new file mode 100644 index 00000000..c5c61703 --- /dev/null +++ b/html-test/tests/Ticket112.html.ref @@ -0,0 +1,82 @@ + +Ticket112
      Safe HaskellNone

      Ticket112

      Synopsis

      • f :: a

      Documentation

      f :: a

      ...given a raw Addr# to the string, and the length of the string. +

      diff --git a/html-test/tests/Ticket61.hs b/html-test/tests/Ticket61.hs new file mode 100644 index 00000000..26ca287f --- /dev/null +++ b/html-test/tests/Ticket61.hs @@ -0,0 +1,3 @@ +module Ticket61 (module Ticket61_Hidden) where + +import Ticket61_Hidden diff --git a/html-test/tests/Ticket61.html.ref b/html-test/tests/Ticket61.html.ref new file mode 100644 index 00000000..8c22488b --- /dev/null +++ b/html-test/tests/Ticket61.html.ref @@ -0,0 +1,80 @@ + +Ticket61
      Safe HaskellNone

      Ticket61

      Documentation

      class C a where

      Methods

      f :: a

      A comment about f +

      diff --git a/html-test/tests/Ticket61_Hidden.hs b/html-test/tests/Ticket61_Hidden.hs new file mode 100644 index 00000000..583c10cd --- /dev/null +++ b/html-test/tests/Ticket61_Hidden.hs @@ -0,0 +1,7 @@ +{-# OPTIONS_HADDOCK hide #-} + +module Ticket61_Hidden where + +class C a where + -- | A comment about f + f :: a diff --git a/html-test/tests/Ticket75.hs b/html-test/tests/Ticket75.hs new file mode 100644 index 00000000..94a2f115 --- /dev/null +++ b/html-test/tests/Ticket75.hs @@ -0,0 +1,7 @@ +module Ticket75 where + +data a :- b = Q + +-- | A reference to ':-' +f :: Int +f = undefined diff --git a/html-test/tests/Ticket75.html.ref b/html-test/tests/Ticket75.html.ref new file mode 100644 index 00000000..cd510ea5 --- /dev/null +++ b/html-test/tests/Ticket75.html.ref @@ -0,0 +1,116 @@ + +Ticket75
      Safe HaskellNone

      Ticket75

      Synopsis

      Documentation

      data a :- b

      Constructors

      Q 

      f :: Int

      A reference to :- +

      diff --git a/html-test/tests/TypeFamilies.hs b/html-test/tests/TypeFamilies.hs new file mode 100644 index 00000000..561f95fd --- /dev/null +++ b/html-test/tests/TypeFamilies.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE TypeFamilies #-} + +module TypeFamilies where + +-- | Type family G +type family G a :: * + +-- | A class with an associated type +class A a where + -- | An associated type + data B a :: * -> * + -- | A method + f :: B a Int + +-- | Doc for family +type family F a + + +-- | Doc for G Int +type instance G Int = Bool +type instance G Float = Int + + +instance A Int where + data B Int x = Con x + f = Con 3 + +g = Con 5 diff --git a/html-test/tests/TypeFamilies.html.ref b/html-test/tests/TypeFamilies.html.ref new file mode 100644 index 00000000..196d60ec --- /dev/null +++ b/html-test/tests/TypeFamilies.html.ref @@ -0,0 +1,212 @@ + +TypeFamilies
      Safe HaskellNone

      TypeFamilies

      Synopsis

      Documentation

      type family G a :: *

      Type family G +

      class A a where

      A class with an associated type +

      Associated Types

      data B a :: * -> *

      An associated type +

      Methods

      f :: B a Int

      A method +

      Instances

      A Int 

      type family F a

      Doc for family +

      diff --git a/html-test/tests/TypeOperators.hs b/html-test/tests/TypeOperators.hs new file mode 100644 index 00000000..edbb9344 --- /dev/null +++ b/html-test/tests/TypeOperators.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE TypeOperators #-} +module TypeOperators ( + -- * stuff + (:-:), + (:+:), + Op, + O(..), + biO, +) where + +data a :-: b + +data (a :+: b) c + +data a `Op` b + +newtype (g `O` f) a = O { unO :: g (f a) } + +biO :: (g `O` f) a +biO = undefined diff --git a/html-test/tests/TypeOperators.html.ref b/html-test/tests/TypeOperators.html.ref new file mode 100644 index 00000000..2b18727f --- /dev/null +++ b/html-test/tests/TypeOperators.html.ref @@ -0,0 +1,185 @@ + +TypeOperators
      Safe HaskellNone

      TypeOperators

      Contents

      Synopsis

      • data a :-: b
      • data (a :+: b) c
      • data Op a b
      • newtype O g f a = O {}
      • biO :: (g `O` f) a

      stuff +

      data a :-: b

      data (a :+: b) c

      data Op a b

      newtype O g f a

      Constructors

      O 

      Fields

      unO :: g (f a)
       

      biO :: (g `O` f) a

      diff --git a/html-test/tests/Unicode.hs.disabled b/html-test/tests/Unicode.hs.disabled new file mode 100644 index 00000000..d5bbf445 --- /dev/null +++ b/html-test/tests/Unicode.hs.disabled @@ -0,0 +1,6 @@ +module Unicode where + +-- | γλώσσα +x :: Int +x = 1 + diff --git a/html-test/tests/Unicode.html.ref b/html-test/tests/Unicode.html.ref new file mode 100644 index 00000000..13ef6c1e --- /dev/null +++ b/html-test/tests/Unicode.html.ref @@ -0,0 +1,82 @@ + +Unicode
      Safe HaskellNone

      Unicode

      Synopsis

      Documentation

      x :: Int

      γλώσσα +

      diff --git a/html-test/tests/Visible.hs b/html-test/tests/Visible.hs new file mode 100644 index 00000000..cad71931 --- /dev/null +++ b/html-test/tests/Visible.hs @@ -0,0 +1,3 @@ +module Visible where +visible :: Int -> Int +visible a = a diff --git a/html-test/tests/Visible.html.ref b/html-test/tests/Visible.html.ref new file mode 100644 index 00000000..de8b8d80 --- /dev/null +++ b/html-test/tests/Visible.html.ref @@ -0,0 +1,67 @@ + +Visible
      Safe HaskellNone

      Visible

      Documentation

      diff --git a/html-test/tests/frames.html.ref b/html-test/tests/frames.html.ref new file mode 100644 index 00000000..1b4e38d4 --- /dev/null +++ b/html-test/tests/frames.html.ref @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + diff --git a/html-test/tests/mini_A.html.ref b/html-test/tests/mini_A.html.ref new file mode 100644 index 00000000..cbe50e41 --- /dev/null +++ b/html-test/tests/mini_A.html.ref @@ -0,0 +1,59 @@ + +A

      A

      diff --git a/html-test/tests/mini_AdvanceTypes.html.ref b/html-test/tests/mini_AdvanceTypes.html.ref new file mode 100644 index 00000000..59d8dcb1 --- /dev/null +++ b/html-test/tests/mini_AdvanceTypes.html.ref @@ -0,0 +1,33 @@ + +AdvanceTypes

      AdvanceTypes

      data Pattern

      diff --git a/html-test/tests/mini_B.html.ref b/html-test/tests/mini_B.html.ref new file mode 100644 index 00000000..211a7deb --- /dev/null +++ b/html-test/tests/mini_B.html.ref @@ -0,0 +1,45 @@ + +B

      B

      diff --git a/html-test/tests/mini_Bug1.html.ref b/html-test/tests/mini_Bug1.html.ref new file mode 100644 index 00000000..adf81c73 --- /dev/null +++ b/html-test/tests/mini_Bug1.html.ref @@ -0,0 +1,33 @@ + +Bug1

      Bug1

      data T

      diff --git a/html-test/tests/mini_Bug2.html.ref b/html-test/tests/mini_Bug2.html.ref new file mode 100644 index 00000000..b673e459 --- /dev/null +++ b/html-test/tests/mini_Bug2.html.ref @@ -0,0 +1,31 @@ + +Bug2

      Bug2

      diff --git a/html-test/tests/mini_Bug3.html.ref b/html-test/tests/mini_Bug3.html.ref new file mode 100644 index 00000000..af4cc445 --- /dev/null +++ b/html-test/tests/mini_Bug3.html.ref @@ -0,0 +1,31 @@ + +Bug3

      Bug3

      diff --git a/html-test/tests/mini_Bug4.html.ref b/html-test/tests/mini_Bug4.html.ref new file mode 100644 index 00000000..b403e94a --- /dev/null +++ b/html-test/tests/mini_Bug4.html.ref @@ -0,0 +1,31 @@ + +Bug4

      Bug4

      diff --git a/html-test/tests/mini_Bug6.html.ref b/html-test/tests/mini_Bug6.html.ref new file mode 100644 index 00000000..5c5c1119 --- /dev/null +++ b/html-test/tests/mini_Bug6.html.ref @@ -0,0 +1,65 @@ + +Bug6

      Bug6

      data A

      data B

      data C

      data D

      data E

      diff --git a/html-test/tests/mini_Bug7.html.ref b/html-test/tests/mini_Bug7.html.ref new file mode 100644 index 00000000..1bec82ee --- /dev/null +++ b/html-test/tests/mini_Bug7.html.ref @@ -0,0 +1,41 @@ + +Bug7

      Bug7

      data Foo

      class Bar x y

      diff --git a/html-test/tests/mini_Bug8.html.ref b/html-test/tests/mini_Bug8.html.ref new file mode 100644 index 00000000..070dbcf8 --- /dev/null +++ b/html-test/tests/mini_Bug8.html.ref @@ -0,0 +1,63 @@ + +Bug8

      Bug8

      diff --git a/html-test/tests/mini_BugDeprecated.html.ref b/html-test/tests/mini_BugDeprecated.html.ref new file mode 100644 index 00000000..f0410137 --- /dev/null +++ b/html-test/tests/mini_BugDeprecated.html.ref @@ -0,0 +1,61 @@ + +BugDeprecated

      BugDeprecated

      diff --git a/html-test/tests/mini_BugExportHeadings.html.ref b/html-test/tests/mini_BugExportHeadings.html.ref new file mode 100644 index 00000000..b481720d --- /dev/null +++ b/html-test/tests/mini_BugExportHeadings.html.ref @@ -0,0 +1,79 @@ + +BugExportHeadings

      BugExportHeadings

      Foo +

      Bar +

      Baz +

      One +

      Two +

      Three +

      diff --git a/html-test/tests/mini_Bugs.html.ref b/html-test/tests/mini_Bugs.html.ref new file mode 100644 index 00000000..3c758375 --- /dev/null +++ b/html-test/tests/mini_Bugs.html.ref @@ -0,0 +1,33 @@ + +Bugs

      Bugs

      data A a

      diff --git a/html-test/tests/mini_CrossPackageDocs.html.ref b/html-test/tests/mini_CrossPackageDocs.html.ref new file mode 100644 index 00000000..4c0588ba --- /dev/null +++ b/html-test/tests/mini_CrossPackageDocs.html.ref @@ -0,0 +1,45 @@ + +CrossPackageDocs

      CrossPackageDocs

      diff --git a/html-test/tests/mini_DeprecatedClass.html.ref b/html-test/tests/mini_DeprecatedClass.html.ref new file mode 100644 index 00000000..3923c1ff --- /dev/null +++ b/html-test/tests/mini_DeprecatedClass.html.ref @@ -0,0 +1,41 @@ + +DeprecatedClass

      DeprecatedClass

      class SomeClass a

      diff --git a/html-test/tests/mini_DeprecatedData.html.ref b/html-test/tests/mini_DeprecatedData.html.ref new file mode 100644 index 00000000..8ef20113 --- /dev/null +++ b/html-test/tests/mini_DeprecatedData.html.ref @@ -0,0 +1,41 @@ + +DeprecatedData

      DeprecatedData

      data Foo

      data One

      diff --git a/html-test/tests/mini_DeprecatedFunction.html.ref b/html-test/tests/mini_DeprecatedFunction.html.ref new file mode 100644 index 00000000..9bb90dac --- /dev/null +++ b/html-test/tests/mini_DeprecatedFunction.html.ref @@ -0,0 +1,37 @@ + +DeprecatedFunction

      DeprecatedFunction

      diff --git a/html-test/tests/mini_DeprecatedFunction2.html.ref b/html-test/tests/mini_DeprecatedFunction2.html.ref new file mode 100644 index 00000000..a03991a9 --- /dev/null +++ b/html-test/tests/mini_DeprecatedFunction2.html.ref @@ -0,0 +1,31 @@ + +DeprecatedFunction2

      DeprecatedFunction2

      diff --git a/html-test/tests/mini_DeprecatedFunction3.html.ref b/html-test/tests/mini_DeprecatedFunction3.html.ref new file mode 100644 index 00000000..4ea60339 --- /dev/null +++ b/html-test/tests/mini_DeprecatedFunction3.html.ref @@ -0,0 +1,31 @@ + +DeprecatedFunction3

      DeprecatedFunction3

      diff --git a/html-test/tests/mini_DeprecatedModule.html.ref b/html-test/tests/mini_DeprecatedModule.html.ref new file mode 100644 index 00000000..bfdef611 --- /dev/null +++ b/html-test/tests/mini_DeprecatedModule.html.ref @@ -0,0 +1,31 @@ + +DeprecatedModule

      DeprecatedModule

      diff --git a/html-test/tests/mini_DeprecatedModule2.html.ref b/html-test/tests/mini_DeprecatedModule2.html.ref new file mode 100644 index 00000000..dbcc43b9 --- /dev/null +++ b/html-test/tests/mini_DeprecatedModule2.html.ref @@ -0,0 +1,31 @@ + +DeprecatedModule2

      DeprecatedModule2

      diff --git a/html-test/tests/mini_DeprecatedNewtype.html.ref b/html-test/tests/mini_DeprecatedNewtype.html.ref new file mode 100644 index 00000000..a913525f --- /dev/null +++ b/html-test/tests/mini_DeprecatedNewtype.html.ref @@ -0,0 +1,41 @@ + +DeprecatedNewtype

      DeprecatedNewtype

      diff --git a/html-test/tests/mini_DeprecatedReExport.html.ref b/html-test/tests/mini_DeprecatedReExport.html.ref new file mode 100644 index 00000000..8316dda5 --- /dev/null +++ b/html-test/tests/mini_DeprecatedReExport.html.ref @@ -0,0 +1,37 @@ + +DeprecatedReExport

      DeprecatedReExport

      Re-exported from an other module +

      Re-exported from an other package +

      diff --git a/html-test/tests/mini_DeprecatedRecord.html.ref b/html-test/tests/mini_DeprecatedRecord.html.ref new file mode 100644 index 00000000..3d949d2d --- /dev/null +++ b/html-test/tests/mini_DeprecatedRecord.html.ref @@ -0,0 +1,33 @@ + +DeprecatedRecord

      DeprecatedRecord

      data Foo

      diff --git a/html-test/tests/mini_DeprecatedTypeFamily.html.ref b/html-test/tests/mini_DeprecatedTypeFamily.html.ref new file mode 100644 index 00000000..c87d9637 --- /dev/null +++ b/html-test/tests/mini_DeprecatedTypeFamily.html.ref @@ -0,0 +1,41 @@ + +DeprecatedTypeFamily

      DeprecatedTypeFamily

      data family SomeTypeFamily k :: * -> *

      data family SomeOtherTypeFamily k :: * -> *

      diff --git a/html-test/tests/mini_DeprecatedTypeSynonym.html.ref b/html-test/tests/mini_DeprecatedTypeSynonym.html.ref new file mode 100644 index 00000000..5ade100d --- /dev/null +++ b/html-test/tests/mini_DeprecatedTypeSynonym.html.ref @@ -0,0 +1,41 @@ + +DeprecatedTypeSynonym

      DeprecatedTypeSynonym

      diff --git a/html-test/tests/mini_DeprecationMessageParseError.html.ref b/html-test/tests/mini_DeprecationMessageParseError.html.ref new file mode 100644 index 00000000..e52f487f --- /dev/null +++ b/html-test/tests/mini_DeprecationMessageParseError.html.ref @@ -0,0 +1,31 @@ + +DeprecationMessageParseError

      DeprecationMessageParseError

      diff --git a/html-test/tests/mini_Examples.html.ref b/html-test/tests/mini_Examples.html.ref new file mode 100644 index 00000000..c99c2c48 --- /dev/null +++ b/html-test/tests/mini_Examples.html.ref @@ -0,0 +1,31 @@ + +Examples

      Examples

      diff --git a/html-test/tests/mini_FunArgs.html.ref b/html-test/tests/mini_FunArgs.html.ref new file mode 100644 index 00000000..89729720 --- /dev/null +++ b/html-test/tests/mini_FunArgs.html.ref @@ -0,0 +1,37 @@ + +FunArgs

      FunArgs

      diff --git a/html-test/tests/mini_GADTRecords.html.ref b/html-test/tests/mini_GADTRecords.html.ref new file mode 100644 index 00000000..a8b838f0 --- /dev/null +++ b/html-test/tests/mini_GADTRecords.html.ref @@ -0,0 +1,33 @@ + +GADTRecords

      GADTRecords

      data H1 a b

      diff --git a/html-test/tests/mini_Hash.html.ref b/html-test/tests/mini_Hash.html.ref new file mode 100644 index 00000000..1e6ad1a9 --- /dev/null +++ b/html-test/tests/mini_Hash.html.ref @@ -0,0 +1,74 @@ + +Hash

      Hash

      The HashTable type +

      data HashTable key val

      Operations on HashTables +

      The Hash class +

      class Hash a

      diff --git a/html-test/tests/mini_HiddenInstances.html.ref b/html-test/tests/mini_HiddenInstances.html.ref new file mode 100644 index 00000000..0f1a2e04 --- /dev/null +++ b/html-test/tests/mini_HiddenInstances.html.ref @@ -0,0 +1,41 @@ + +HiddenInstances

      HiddenInstances

      diff --git a/html-test/tests/mini_HiddenInstancesB.html.ref b/html-test/tests/mini_HiddenInstancesB.html.ref new file mode 100644 index 00000000..3ce4f6a9 --- /dev/null +++ b/html-test/tests/mini_HiddenInstancesB.html.ref @@ -0,0 +1,41 @@ + +HiddenInstancesB

      HiddenInstancesB

      class Foo a

      data Bar

      diff --git a/html-test/tests/mini_Hyperlinks.html.ref b/html-test/tests/mini_Hyperlinks.html.ref new file mode 100644 index 00000000..f0c7d65a --- /dev/null +++ b/html-test/tests/mini_Hyperlinks.html.ref @@ -0,0 +1,31 @@ + +Hyperlinks

      Hyperlinks

      diff --git a/html-test/tests/mini_IgnoreExports.html.ref b/html-test/tests/mini_IgnoreExports.html.ref new file mode 100644 index 00000000..a420e65a --- /dev/null +++ b/html-test/tests/mini_IgnoreExports.html.ref @@ -0,0 +1,37 @@ + +IgnoreExports

      IgnoreExports

      diff --git a/html-test/tests/mini_ModuleWithWarning.html.ref b/html-test/tests/mini_ModuleWithWarning.html.ref new file mode 100644 index 00000000..19315a14 --- /dev/null +++ b/html-test/tests/mini_ModuleWithWarning.html.ref @@ -0,0 +1,31 @@ + +ModuleWithWarning

      ModuleWithWarning

      diff --git a/html-test/tests/mini_NamedDoc.html.ref b/html-test/tests/mini_NamedDoc.html.ref new file mode 100644 index 00000000..066bbc61 --- /dev/null +++ b/html-test/tests/mini_NamedDoc.html.ref @@ -0,0 +1,25 @@ + +NamedDoc

      NamedDoc

      diff --git a/html-test/tests/mini_NoLayout.html.ref b/html-test/tests/mini_NoLayout.html.ref new file mode 100644 index 00000000..19562d70 --- /dev/null +++ b/html-test/tests/mini_NoLayout.html.ref @@ -0,0 +1,31 @@ + +NoLayout

      NoLayout

      diff --git a/html-test/tests/mini_NonGreedy.html.ref b/html-test/tests/mini_NonGreedy.html.ref new file mode 100644 index 00000000..698c368e --- /dev/null +++ b/html-test/tests/mini_NonGreedy.html.ref @@ -0,0 +1,31 @@ + +NonGreedy

      NonGreedy

      diff --git a/html-test/tests/mini_Properties.html.ref b/html-test/tests/mini_Properties.html.ref new file mode 100644 index 00000000..5f538dfd --- /dev/null +++ b/html-test/tests/mini_Properties.html.ref @@ -0,0 +1,31 @@ + +Properties

      Properties

      diff --git a/html-test/tests/mini_PruneWithWarning.html.ref b/html-test/tests/mini_PruneWithWarning.html.ref new file mode 100644 index 00000000..9eb3aa00 --- /dev/null +++ b/html-test/tests/mini_PruneWithWarning.html.ref @@ -0,0 +1,25 @@ + +PruneWithWarning

      PruneWithWarning

      diff --git a/html-test/tests/mini_QuasiExpr.html.ref b/html-test/tests/mini_QuasiExpr.html.ref new file mode 100644 index 00000000..7dd9b829 --- /dev/null +++ b/html-test/tests/mini_QuasiExpr.html.ref @@ -0,0 +1,59 @@ + +QuasiExpr

      QuasiExpr

      diff --git a/html-test/tests/mini_QuasiQuote.html.ref b/html-test/tests/mini_QuasiQuote.html.ref new file mode 100644 index 00000000..5dac6acc --- /dev/null +++ b/html-test/tests/mini_QuasiQuote.html.ref @@ -0,0 +1,31 @@ + +QuasiQuote

      QuasiQuote

      diff --git a/html-test/tests/mini_TH.html.ref b/html-test/tests/mini_TH.html.ref new file mode 100644 index 00000000..d2ddbabc --- /dev/null +++ b/html-test/tests/mini_TH.html.ref @@ -0,0 +1,31 @@ + +TH

      TH

      diff --git a/html-test/tests/mini_TH2.html.ref b/html-test/tests/mini_TH2.html.ref new file mode 100644 index 00000000..2c9f1340 --- /dev/null +++ b/html-test/tests/mini_TH2.html.ref @@ -0,0 +1,31 @@ + +TH2

      TH2

      diff --git a/html-test/tests/mini_Test.html.ref b/html-test/tests/mini_Test.html.ref new file mode 100644 index 00000000..26db2c0f --- /dev/null +++ b/html-test/tests/mini_Test.html.ref @@ -0,0 +1,269 @@ + +Test

      Test

      Type declarations +

      Data types +

      data T a b

      data T2 a b

      data T3 a b

      data T4 a b

      data T5 a b

      data T6

      data N1 a

      data N2 a b

      data N3 a b

      data N4 a b

      data N5 a b

      data N6 a b

      data N7 a b

      Records +

      data R

      data R1

      Class declarations +

      class C a

      class D a

      class E a

      class F a

      Function types +

      Auxiliary stuff +

      A hidden module +

      A visible module +

      Existential / Universal types +

      data Ex a

      Type signatures with argument docs +

      A section +

      A subsection +

      diff --git a/html-test/tests/mini_Ticket112.html.ref b/html-test/tests/mini_Ticket112.html.ref new file mode 100644 index 00000000..68a0a5e5 --- /dev/null +++ b/html-test/tests/mini_Ticket112.html.ref @@ -0,0 +1,31 @@ + +Ticket112

      Ticket112

      diff --git a/html-test/tests/mini_Ticket61.html.ref b/html-test/tests/mini_Ticket61.html.ref new file mode 100644 index 00000000..a73fefca --- /dev/null +++ b/html-test/tests/mini_Ticket61.html.ref @@ -0,0 +1,33 @@ + +Ticket61

      Ticket61

      class C a

      diff --git a/html-test/tests/mini_Ticket75.html.ref b/html-test/tests/mini_Ticket75.html.ref new file mode 100644 index 00000000..75ce882c --- /dev/null +++ b/html-test/tests/mini_Ticket75.html.ref @@ -0,0 +1,39 @@ + +Ticket75

      Ticket75

      data a :- b

      diff --git a/html-test/tests/mini_TypeFamilies.html.ref b/html-test/tests/mini_TypeFamilies.html.ref new file mode 100644 index 00000000..0cf39c88 --- /dev/null +++ b/html-test/tests/mini_TypeFamilies.html.ref @@ -0,0 +1,55 @@ + +TypeFamilies

      TypeFamilies

      type family G a :: *

      class A a

      type family F a

      diff --git a/html-test/tests/mini_TypeOperators.html.ref b/html-test/tests/mini_TypeOperators.html.ref new file mode 100644 index 00000000..86b6beec --- /dev/null +++ b/html-test/tests/mini_TypeOperators.html.ref @@ -0,0 +1,66 @@ + +TypeOperators

      TypeOperators

      stuff +

      data a :-: b

      data (a :+: b) c

      data Op a b

      data O g f a

      diff --git a/html-test/tests/mini_Unicode.html.ref b/html-test/tests/mini_Unicode.html.ref new file mode 100644 index 00000000..55336980 --- /dev/null +++ b/html-test/tests/mini_Unicode.html.ref @@ -0,0 +1,31 @@ + +Unicode

      Unicode

      diff --git a/html-test/tests/mini_Visible.html.ref b/html-test/tests/mini_Visible.html.ref new file mode 100644 index 00000000..976a30c5 --- /dev/null +++ b/html-test/tests/mini_Visible.html.ref @@ -0,0 +1,31 @@ + +Visible

      Visible

      diff --git a/tests/html-tests/README b/tests/html-tests/README deleted file mode 100644 index 9afb10e7..00000000 --- a/tests/html-tests/README +++ /dev/null @@ -1,24 +0,0 @@ -This is a testsuite for Haddock that uses the concept of "golden files". That -is, it compares output files against a set of reference files. - -To add a new test: - - 1) Create a module in the "tests" directory. - - 2) Run "cabal test". You should now have output/.html. The test - passes since there is no reference file to compare with. - - 3) To make a reference file from the output file, do - runhaskell accept.hs - -Tips and tricks: - -To "accept" all output files (copy them to reference files), run - runhaskell accept.hs - -You can run all tests despite failing tests, like so - cabal test --test-option=all - -You can pass extra options to haddock like so - cabal test --test-options='all --title="All Tests"' - diff --git a/tests/html-tests/accept.hs b/tests/html-tests/accept.hs deleted file mode 100644 index 45b32078..00000000 --- a/tests/html-tests/accept.hs +++ /dev/null @@ -1,43 +0,0 @@ -import System.Cmd -import System.Environment -import System.FilePath -import System.Exit -import System.Directory -import Data.List -import Control.Monad -import Control.Applicative - - -main = do - args <- getArgs - dir <- getCurrentDirectory - contents <- filter (`notElem` ignore) <$> getDirectoryContents (dir "output") - if not $ null args - then - mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] - else - mapM_ copy [ "output" file | file <- contents, ".html" `isSuffixOf` file ] - where - ignore = [ - "doc-index.html" - , "index-frames.html" - , "index.html" - ] - - -copy file = do - let new = "tests" takeFileName file <.> ".ref" - print file - print new - contents <- readFile file - writeFile new (stripLinks contents) - - -stripLinks str = - let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs deleted file mode 100644 index 759f7495..00000000 --- a/tests/html-tests/runtests.hs +++ /dev/null @@ -1,152 +0,0 @@ -import Prelude hiding (mod) -import Control.Monad -import Control.Applicative -import Data.List -import Data.Maybe -import Distribution.InstalledPackageInfo -import Distribution.Package (PackageName (..)) -import Distribution.Simple.Compiler -import Distribution.Simple.GHC -import Distribution.Simple.PackageIndex -import Distribution.Simple.Program -import Distribution.Simple.Utils -import Distribution.Verbosity -import System.IO -import System.Cmd -import System.Directory -import System.Environment -import System.Exit -import System.FilePath -import System.Process (ProcessHandle, runProcess, waitForProcess) - - -packageRoot, dataDir, haddockPath, testSuiteRoot, testDir, outDir :: FilePath -packageRoot = "." -dataDir = packageRoot "resources" -haddockPath = packageRoot "dist" "build" "haddock" "haddock" -testSuiteRoot = packageRoot "tests" "html-tests" -testDir = testSuiteRoot "tests" -outDir = testSuiteRoot "output" - - -main :: IO () -main = do - test - putStrLn "All tests passed!" - - -test :: IO () -test = do - x <- doesFileExist haddockPath - unless x $ die "you need to run 'cabal build' successfully first" - - contents <- getDirectoryContents testDir - args <- getArgs - let (opts, spec) = span ("-" `isPrefixOf`) args - let mods = - case spec of - y:_ | y /= "all" -> [y ++ ".hs"] - _ -> filter ((==) ".hs" . takeExtension) contents - - let mods' = map (testDir ) mods - - -- add haddock_datadir to environment for subprocesses - env <- Just . (:) ("haddock_datadir", dataDir) <$> getEnvironment - - putStrLn "" - putStrLn "Haddock version: " - h1 <- runProcess haddockPath ["--version"] Nothing - env Nothing Nothing Nothing - wait h1 "*** Running `haddock --version' failed!" - putStrLn "" - putStrLn "GHC version: " - h2 <- runProcess haddockPath ["--ghc-version"] Nothing - env Nothing Nothing Nothing - wait h2 "*** Running `haddock --ghc-version' failed!" - putStrLn "" - - -- TODO: maybe do something more clever here using haddock.cabal - ghcPath <- fmap init $ rawSystemStdout normal haddockPath ["--print-ghc-path"] - (_, conf) <- configure normal (Just ghcPath) Nothing defaultProgramConfiguration - pkgIndex <- getInstalledPackages normal [GlobalPackageDB] conf - let mkDep pkgName = - fromMaybe (error "Couldn't find test dependencies") $ do - let pkgs = lookupPackageName pkgIndex (PackageName pkgName) - (_, pkgs') <- listToMaybe pkgs - pkg <- listToMaybe pkgs' - ifacePath <- listToMaybe (haddockInterfaces pkg) - htmlPath <- listToMaybe (haddockHTMLs pkg) - return ("-i " ++ htmlPath ++ "," ++ ifacePath) - - let base = mkDep "base" - process = mkDep "process" - ghcprim = mkDep "ghc-prim" - - putStrLn "Running tests..." - handle <- runProcess haddockPath - (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts" - , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods') - Nothing env Nothing - Nothing Nothing - - wait handle "*** Haddock run failed! Exiting." - check mods (if not (null args) && args !! 0 == "all" then False else True) - where - wait :: ProcessHandle -> String -> IO () - wait h msg = do - r <- waitForProcess h - unless (r == ExitSuccess) $ do - hPutStrLn stderr msg - exitFailure - -check :: [FilePath] -> Bool -> IO () -check modules strict = do - forM_ modules $ \mod -> do - let outfile = outDir dropExtension mod ++ ".html" - let reffile = testDir dropExtension mod ++ ".html.ref" - b <- doesFileExist reffile - if b - then do - copyFile reffile (outDir takeFileName reffile) - out <- readFile outfile - ref <- readFile reffile - if not $ haddockEq out ref - then do - putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" - let ref' = stripLinks ref - out' = stripLinks out - let reffile' = outDir takeFileName reffile ++ ".nolinks" - outfile' = outDir takeFileName outfile ++ ".nolinks" - writeFile reffile' ref' - writeFile outfile' out' - r <- programOnPath "colordiff" - code <- if r - then system $ "colordiff " ++ reffile' ++ " " ++ outfile' - else system $ "diff " ++ reffile' ++ " " ++ outfile' - if strict then exitFailure else return () - unless (code == ExitSuccess) $ do - hPutStrLn stderr "*** Running diff failed!" - exitFailure - else do - putStrLn $ "Pass: " ++ mod - else do - putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" - - -haddockEq :: String -> String -> Bool -haddockEq file1 file2 = stripLinks file1 == stripLinks file2 - -stripLinks :: String -> String -stripLinks str = - let prefix = " prefix ++ stripLinks (dropWhile (/= '"') str') - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs - -programOnPath :: FilePath -> IO Bool -programOnPath p = do - result <- findProgramLocation silent p - return (isJust result) diff --git a/tests/html-tests/tests/A.hs b/tests/html-tests/tests/A.hs deleted file mode 100644 index 606b0865..00000000 --- a/tests/html-tests/tests/A.hs +++ /dev/null @@ -1,17 +0,0 @@ -module A where - -data A = A - -other :: Int -other = 2 - --- | Doc for test2 -test2 :: Bool -test2 = False - --- | Should show up on the page for both modules A and B -data X = X -- ^ Doc for consructor - --- | Should show up on the page for both modules A and B -reExport :: Int -reExport = 1 diff --git a/tests/html-tests/tests/A.html.ref b/tests/html-tests/tests/A.html.ref deleted file mode 100644 index 328fec02..00000000 --- a/tests/html-tests/tests/A.html.ref +++ /dev/null @@ -1,183 +0,0 @@ - -A
      Safe HaskellNone

      A

      Synopsis

      Documentation

      data A

      Constructors

      A 

      test2 :: Bool

      Doc for test2 -

      data X

      Should show up on the page for both modules A and B -

      Constructors

      X

      Doc for consructor -

      reExport :: Int

      Should show up on the page for both modules A and B -

      diff --git a/tests/html-tests/tests/AdvanceTypes.hs b/tests/html-tests/tests/AdvanceTypes.hs deleted file mode 100644 index 939fdf07..00000000 --- a/tests/html-tests/tests/AdvanceTypes.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE TypeOperators #-} -module AdvanceTypes where - -data Pattern :: [*] -> * where - Nil :: Pattern '[] - Cons :: Maybe h -> Pattern t -> Pattern (h ': t) diff --git a/tests/html-tests/tests/AdvanceTypes.html.ref b/tests/html-tests/tests/AdvanceTypes.html.ref deleted file mode 100644 index bac545be..00000000 --- a/tests/html-tests/tests/AdvanceTypes.html.ref +++ /dev/null @@ -1,97 +0,0 @@ - -AdvanceTypes
      Safe HaskellNone

      AdvanceTypes

      Documentation

      data Pattern where

      Constructors

      Nil :: Pattern `[]` 
      Cons :: Maybe h -> Pattern t -> Pattern (h : t) 
      diff --git a/tests/html-tests/tests/B.hs b/tests/html-tests/tests/B.hs deleted file mode 100644 index 5fd69acd..00000000 --- a/tests/html-tests/tests/B.hs +++ /dev/null @@ -1,8 +0,0 @@ -module B ( module A, test, reExport, X(..) ) where -import A ( A(..), test2, reExport, X(..) ) - --- | This link shouldn't work: 'other'. --- These links should work: 'A.other', 'Data.List.sortBy', 'test2', 'A.test2', 'Data.Maybe.fromMaybe'. --- Module link: "Prelude". -test :: Int -test = 1 diff --git a/tests/html-tests/tests/B.html.ref b/tests/html-tests/tests/B.html.ref deleted file mode 100644 index 410bc75b..00000000 --- a/tests/html-tests/tests/B.html.ref +++ /dev/null @@ -1,175 +0,0 @@ - -B
      Safe HaskellNone

      B

      Synopsis

      Documentation

      module A

      test :: Int

      This link shouldn't work: other. - These links should work: other, sortBy, test2, test2, fromMaybe. - Module link: Prelude. -

      reExport :: Int

      Should show up on the page for both modules A and B -

      data X

      Should show up on the page for both modules A and B -

      Constructors

      X

      Doc for consructor -

      diff --git a/tests/html-tests/tests/Bug1.hs b/tests/html-tests/tests/Bug1.hs deleted file mode 100644 index af1ed4d3..00000000 --- a/tests/html-tests/tests/Bug1.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Bug1 where - --- | We should have different anchors for constructors and types\/classes. This --- hyperlink should point to the type constructor by default: 'T'. -data T = T - diff --git a/tests/html-tests/tests/Bug1.html.ref b/tests/html-tests/tests/Bug1.html.ref deleted file mode 100644 index f8a86948..00000000 --- a/tests/html-tests/tests/Bug1.html.ref +++ /dev/null @@ -1,103 +0,0 @@ - -Bug1
      Safe HaskellNone

      Bug1

      Synopsis

      • data T = T

      Documentation

      data T

      We should have different anchors for constructors and types/classes. This - hyperlink should point to the type constructor by default: T. -

      Constructors

      T 
      diff --git a/tests/html-tests/tests/Bug2.hs b/tests/html-tests/tests/Bug2.hs deleted file mode 100644 index 9121922e..00000000 --- a/tests/html-tests/tests/Bug2.hs +++ /dev/null @@ -1,4 +0,0 @@ -module Bug2 ( x ) where -import B -x :: A -x = A diff --git a/tests/html-tests/tests/Bug2.html.ref b/tests/html-tests/tests/Bug2.html.ref deleted file mode 100644 index 813035a6..00000000 --- a/tests/html-tests/tests/Bug2.html.ref +++ /dev/null @@ -1,65 +0,0 @@ - -Bug2
      Safe HaskellNone

      Bug2

      Documentation

      x :: A

      diff --git a/tests/html-tests/tests/Bug3.hs b/tests/html-tests/tests/Bug3.hs deleted file mode 100644 index 67e57892..00000000 --- a/tests/html-tests/tests/Bug3.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Bug3 where - --- | /multi-line --- emphasis/ -foo :: Int -foo = undefined diff --git a/tests/html-tests/tests/Bug3.html.ref b/tests/html-tests/tests/Bug3.html.ref deleted file mode 100644 index 76d4e730..00000000 --- a/tests/html-tests/tests/Bug3.html.ref +++ /dev/null @@ -1,83 +0,0 @@ - -Bug3
      Safe HaskellNone

      Bug3

      Synopsis

      Documentation

      foo :: Int

      /multi-line - emphasis/ -

      diff --git a/tests/html-tests/tests/Bug4.hs b/tests/html-tests/tests/Bug4.hs deleted file mode 100644 index 425a77aa..00000000 --- a/tests/html-tests/tests/Bug4.hs +++ /dev/null @@ -1,5 +0,0 @@ -module Bug4 where --- | don't use apostrophe's in the wrong place's -foo :: Int -foo = undefined - diff --git a/tests/html-tests/tests/Bug4.html.ref b/tests/html-tests/tests/Bug4.html.ref deleted file mode 100644 index 9e852978..00000000 --- a/tests/html-tests/tests/Bug4.html.ref +++ /dev/null @@ -1,82 +0,0 @@ - -Bug4
      Safe HaskellNone

      Bug4

      Synopsis

      Documentation

      foo :: Int

      don't use apostrophe's in the wrong place's -

      diff --git a/tests/html-tests/tests/Bug6.hs b/tests/html-tests/tests/Bug6.hs deleted file mode 100644 index 17411f31..00000000 --- a/tests/html-tests/tests/Bug6.hs +++ /dev/null @@ -1,23 +0,0 @@ --- | Exporting records. -module Bug6( A(A), B(B), b, C(C,c1,c2), D(D,d1), E(E) ) where - --- | --- This record is exported without its field -data A = A { a :: Int } - --- | --- .. with its field, but the field is named separately in the export list --- (the field isn't documented separately since it is already documented here) -data B = B { b :: Int } - --- | --- .. with fields names as subordinate names in the export -data C = C { c1 :: Int, c2 :: Int } - --- | --- .. with only some of the fields exported (we can't handle this one - --- how do we render the declaration?) -data D = D { d1 :: Int, d2 :: Int } - --- | a newtype with a field -newtype E = E { e :: Int } diff --git a/tests/html-tests/tests/Bug6.html.ref b/tests/html-tests/tests/Bug6.html.ref deleted file mode 100644 index 606e45e3..00000000 --- a/tests/html-tests/tests/Bug6.html.ref +++ /dev/null @@ -1,335 +0,0 @@ - -Bug6
      Safe HaskellNone

      Bug6

      Description

      Exporting records. -

      Synopsis

      Documentation

      data A

      This record is exported without its field -

      Constructors

      A Int 

      data B

      .. with its field, but the field is named separately in the export list - (the field isn't documented separately since it is already documented here) -

      Constructors

      B 

      Fields

      b :: Int
       

      data C

      .. with fields names as subordinate names in the export -

      Constructors

      C 

      Fields

      c1 :: Int
       
      c2 :: Int
       

      data D

      .. with only some of the fields exported (we can't handle this one - - how do we render the declaration?) -

      Constructors

      D Int Int 

      newtype E

      a newtype with a field -

      Constructors

      E Int 
      diff --git a/tests/html-tests/tests/Bug7.hs b/tests/html-tests/tests/Bug7.hs deleted file mode 100644 index 8cf57914..00000000 --- a/tests/html-tests/tests/Bug7.hs +++ /dev/null @@ -1,12 +0,0 @@ --- | This module caused a duplicate instance in the documentation for the Foo --- type. -module Bug7 where - --- | The Foo datatype -data Foo = Foo - --- | The Bar class -class Bar x y - --- | Just one instance -instance Bar Foo Foo diff --git a/tests/html-tests/tests/Bug7.html.ref b/tests/html-tests/tests/Bug7.html.ref deleted file mode 100644 index 8ac72b16..00000000 --- a/tests/html-tests/tests/Bug7.html.ref +++ /dev/null @@ -1,173 +0,0 @@ - -Bug7
      Safe HaskellNone

      Bug7

      Description

      This module caused a duplicate instance in the documentation for the Foo - type. -

      Synopsis

      Documentation

      data Foo

      The Foo datatype -

      Constructors

      Foo 

      Instances

      Bar Foo Foo

      Just one instance -

      class Bar x y

      The Bar class -

      Instances

      Bar Foo Foo

      Just one instance -

      diff --git a/tests/html-tests/tests/Bug8.hs b/tests/html-tests/tests/Bug8.hs deleted file mode 100644 index 18df63c8..00000000 --- a/tests/html-tests/tests/Bug8.hs +++ /dev/null @@ -1,14 +0,0 @@ -module Bug8 where - -infix --> -infix ---> - -data Typ = Type (String,[Typ]) - | TFree (String, [String]) - -x --> y = Type("fun",[s,t]) -(--->) = flip $ foldr (-->) - -s = undefined -t = undefined -main = undefined diff --git a/tests/html-tests/tests/Bug8.html.ref b/tests/html-tests/tests/Bug8.html.ref deleted file mode 100644 index 469151f1..00000000 --- a/tests/html-tests/tests/Bug8.html.ref +++ /dev/null @@ -1,131 +0,0 @@ - -Bug8
      Safe HaskellNone

      Bug8

      Documentation

      data Typ

      Constructors

      Type (String, [Typ]) 
      TFree (String, [String]) 

      (-->) :: t -> t1 -> Typ

      (--->) :: [a] -> Typ -> Typ

      s :: a

      t :: a

      main :: a

      diff --git a/tests/html-tests/tests/BugDeprecated.hs b/tests/html-tests/tests/BugDeprecated.hs deleted file mode 100644 index 0f7ac2eb..00000000 --- a/tests/html-tests/tests/BugDeprecated.hs +++ /dev/null @@ -1,18 +0,0 @@ -module BugDeprecated where - -foo, bar, baz :: Int -foo = 23 -bar = 23 -baz = 23 -{-# DEPRECATED foo "for foo" #-} -{-# DEPRECATED bar "for bar" #-} -{-# DEPRECATED baz "for baz" #-} - --- | some documentation for one, two and three -one, two, three :: Int -one = 23 -two = 23 -three = 23 -{-# DEPRECATED one "for one" #-} -{-# DEPRECATED two "for two" #-} -{-# DEPRECATED three "for three" #-} diff --git a/tests/html-tests/tests/BugDeprecated.html.ref b/tests/html-tests/tests/BugDeprecated.html.ref deleted file mode 100644 index 913b189d..00000000 --- a/tests/html-tests/tests/BugDeprecated.html.ref +++ /dev/null @@ -1,198 +0,0 @@ - -BugDeprecated
      Safe HaskellNone

      BugDeprecated

      Synopsis

      Documentation

      foo :: Int

      Deprecated: for foo -

      baz :: Int

      Deprecated: for baz -

      bar :: Int

      Deprecated: for bar -

      one :: Int

      Deprecated: for one -

      some documentation for one, two and three -

      three :: Int

      Deprecated: for three -

      some documentation for one, two and three -

      two :: Int

      Deprecated: for two -

      some documentation for one, two and three -

      diff --git a/tests/html-tests/tests/BugExportHeadings.hs b/tests/html-tests/tests/BugExportHeadings.hs deleted file mode 100644 index a5493a08..00000000 --- a/tests/html-tests/tests/BugExportHeadings.hs +++ /dev/null @@ -1,29 +0,0 @@ --- test for #192 -module BugExportHeadings ( --- * Foo - foo --- * Bar -, bar --- * Baz -, baz - --- * One -, one --- * Two -, two --- * Three -, three -) where - -foo, bar, baz :: Int -foo = 23 -bar = 23 -baz = 23 - -one, two, three :: Int -one = 23 -two = 23 -three = 23 -{-# DEPRECATED one "for one" #-} -{-# DEPRECATED two "for two" #-} -{-# DEPRECATED three "for three" #-} diff --git a/tests/html-tests/tests/BugExportHeadings.html.ref b/tests/html-tests/tests/BugExportHeadings.html.ref deleted file mode 100644 index 457e2c50..00000000 --- a/tests/html-tests/tests/BugExportHeadings.html.ref +++ /dev/null @@ -1,220 +0,0 @@ - -BugExportHeadings
      Safe HaskellNone

      BugExportHeadings

      Synopsis

      Foo -

      foo :: Int

      Bar -

      bar :: Int

      Baz -

      baz :: Int

      One -

      one :: Int

      Deprecated: for one -

      Two -

      two :: Int

      Deprecated: for two -

      Three -

      three :: Int

      Deprecated: for three -

      diff --git a/tests/html-tests/tests/Bugs.hs b/tests/html-tests/tests/Bugs.hs deleted file mode 100644 index 8e1f0079..00000000 --- a/tests/html-tests/tests/Bugs.hs +++ /dev/null @@ -1,3 +0,0 @@ -module Bugs where - -data A a = A a (a -> Int) diff --git a/tests/html-tests/tests/Bugs.html.ref b/tests/html-tests/tests/Bugs.html.ref deleted file mode 100644 index c5a4ca9d..00000000 --- a/tests/html-tests/tests/Bugs.html.ref +++ /dev/null @@ -1,81 +0,0 @@ - -Bugs
      Safe HaskellNone

      Bugs

      Documentation

      data A a

      Constructors

      A a (a -> Int) 
      diff --git a/tests/html-tests/tests/CrossPackageDocs.hs b/tests/html-tests/tests/CrossPackageDocs.hs deleted file mode 100644 index 4d529f79..00000000 --- a/tests/html-tests/tests/CrossPackageDocs.hs +++ /dev/null @@ -1,4 +0,0 @@ -module CrossPackageDocs (map, IsString(..), runInteractiveProcess) where - -import System.Process -import Data.String diff --git a/tests/html-tests/tests/CrossPackageDocs.html.ref b/tests/html-tests/tests/CrossPackageDocs.html.ref deleted file mode 100644 index fea3d0cc..00000000 --- a/tests/html-tests/tests/CrossPackageDocs.html.ref +++ /dev/null @@ -1,298 +0,0 @@ - -CrossPackageDocs
      Safe HaskellNone

      CrossPackageDocs

      Synopsis

      Documentation

      map :: (a -> b) -> [a] -> [b]

      map f xs is the list obtained by applying f to each element - of xs, i.e., -

       map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
      - map f [x1, x2, ...] == [f x1, f x2, ...]
      -

      class IsString a where

      Class for string-like datastructures; used by the overloaded string - extension (-foverloaded-strings in GHC). -

      Methods

      fromString :: String -> a

      Instances

      runInteractiveProcess

      Arguments

      :: FilePath

      Filename of the executable (see proc for details) -

      -> [String]

      Arguments to pass to the executable -

      -> Maybe FilePath

      Optional path to the working directory -

      -> Maybe [(String, String)]

      Optional environment (otherwise inherit) -

      -> IO (Handle, Handle, Handle, ProcessHandle) 

      Runs a raw command, and returns Handles that may be used to communicate - with the process via its stdin, stdout and stderr respectively. -

      For example, to start a process and feed a string to its stdin: -

         (inp,out,err,pid) <- runInteractiveProcess "..."
      -   forkIO (hPutStr inp str)
      -

      The Handles are initially in binary mode; if you need them to be - in text mode then use hSetBinaryMode. -

      diff --git a/tests/html-tests/tests/DeprecatedClass.hs b/tests/html-tests/tests/DeprecatedClass.hs deleted file mode 100644 index 018904ab..00000000 --- a/tests/html-tests/tests/DeprecatedClass.hs +++ /dev/null @@ -1,15 +0,0 @@ -module DeprecatedClass where - --- | some class -class SomeClass a where - -- | documentation for foo - foo :: a -> a - -{-# DEPRECATED SomeClass "SomeClass" #-} -{-# DEPRECATED foo "foo" #-} - -class SomeOtherClass a where - bar :: a -> a - -{-# DEPRECATED SomeOtherClass "SomeOtherClass" #-} -{-# DEPRECATED bar "bar" #-} diff --git a/tests/html-tests/tests/DeprecatedClass.html.ref b/tests/html-tests/tests/DeprecatedClass.html.ref deleted file mode 100644 index d716c1d8..00000000 --- a/tests/html-tests/tests/DeprecatedClass.html.ref +++ /dev/null @@ -1,161 +0,0 @@ - -DeprecatedClass
      Safe HaskellNone

      DeprecatedClass

      Synopsis

      Documentation

      class SomeClass a where

      Deprecated: SomeClass -

      some class -

      Methods

      foo :: a -> a

      Deprecated: foo -

      documentation for foo -

      class SomeOtherClass a where

      Deprecated: SomeOtherClass -

      Methods

      bar :: a -> a

      Deprecated: bar -

      diff --git a/tests/html-tests/tests/DeprecatedData.hs b/tests/html-tests/tests/DeprecatedData.hs deleted file mode 100644 index c40ba122..00000000 --- a/tests/html-tests/tests/DeprecatedData.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# LANGUAGE TypeFamilies #-} -module DeprecatedData where - --- | type Foo -data Foo = Foo -- ^ constructor Foo - | Bar -- ^ constructor Bar - -{-# DEPRECATED Foo "Foo" #-} -{-# DEPRECATED Bar "Bar" #-} - -data One = One - | Two - -{-# DEPRECATED One "One" #-} -{-# DEPRECATED Two "Two" #-} diff --git a/tests/html-tests/tests/DeprecatedData.html.ref b/tests/html-tests/tests/DeprecatedData.html.ref deleted file mode 100644 index 24758345..00000000 --- a/tests/html-tests/tests/DeprecatedData.html.ref +++ /dev/null @@ -1,198 +0,0 @@ - -DeprecatedData
      Safe HaskellNone

      DeprecatedData

      Synopsis

      Documentation

      data Foo

      Deprecated: Foo -

      type Foo -

      Constructors

      Foo

      Deprecated: Foo -

      constructor Foo -

      Bar

      Deprecated: Bar -

      constructor Bar -

      data One

      Deprecated: One -

      Constructors

      One

      Deprecated: One -

      Two

      Deprecated: Two -

      diff --git a/tests/html-tests/tests/DeprecatedFunction.hs b/tests/html-tests/tests/DeprecatedFunction.hs deleted file mode 100644 index 8d626435..00000000 --- a/tests/html-tests/tests/DeprecatedFunction.hs +++ /dev/null @@ -1,10 +0,0 @@ -module DeprecatedFunction where - --- | some documentation for foo -foo :: Int -foo = 23 -{-# DEPRECATED foo "use `bar` instead" #-} - --- | some documentation for bar -bar :: Int -bar = 42 diff --git a/tests/html-tests/tests/DeprecatedFunction.html.ref b/tests/html-tests/tests/DeprecatedFunction.html.ref deleted file mode 100644 index 1fc678bb..00000000 --- a/tests/html-tests/tests/DeprecatedFunction.html.ref +++ /dev/null @@ -1,110 +0,0 @@ - -DeprecatedFunction
      Safe HaskellNone

      DeprecatedFunction

      Synopsis

      Documentation

      foo :: Int

      Deprecated: use bar instead -

      some documentation for foo -

      bar :: Int

      some documentation for bar -

      diff --git a/tests/html-tests/tests/DeprecatedFunction2.hs b/tests/html-tests/tests/DeprecatedFunction2.hs deleted file mode 100644 index bdbbf95c..00000000 --- a/tests/html-tests/tests/DeprecatedFunction2.hs +++ /dev/null @@ -1,6 +0,0 @@ -module DeprecatedFunction2 where - - -foo :: Int -foo = 23 -{-# DEPRECATED foo "use bar instead" #-} diff --git a/tests/html-tests/tests/DeprecatedFunction2.html.ref b/tests/html-tests/tests/DeprecatedFunction2.html.ref deleted file mode 100644 index b5068c8e..00000000 --- a/tests/html-tests/tests/DeprecatedFunction2.html.ref +++ /dev/null @@ -1,84 +0,0 @@ - -DeprecatedFunction2
      Safe HaskellNone

      DeprecatedFunction2

      Synopsis

      Documentation

      foo :: Int

      Deprecated: use bar instead -

      diff --git a/tests/html-tests/tests/DeprecatedFunction3.hs b/tests/html-tests/tests/DeprecatedFunction3.hs deleted file mode 100644 index ca719bda..00000000 --- a/tests/html-tests/tests/DeprecatedFunction3.hs +++ /dev/null @@ -1,6 +0,0 @@ -module DeprecatedFunction3 where - - - -foo = 23 -{-# DEPRECATED foo "use bar instead" #-} diff --git a/tests/html-tests/tests/DeprecatedFunction3.html.ref b/tests/html-tests/tests/DeprecatedFunction3.html.ref deleted file mode 100644 index f24eb666..00000000 --- a/tests/html-tests/tests/DeprecatedFunction3.html.ref +++ /dev/null @@ -1,84 +0,0 @@ - -DeprecatedFunction3
      Safe HaskellNone

      DeprecatedFunction3

      Synopsis

      Documentation

      foo :: Integer

      Deprecated: use bar instead -

      diff --git a/tests/html-tests/tests/DeprecatedModule.hs b/tests/html-tests/tests/DeprecatedModule.hs deleted file mode 100644 index 369dba4f..00000000 --- a/tests/html-tests/tests/DeprecatedModule.hs +++ /dev/null @@ -1,5 +0,0 @@ --- | Documentation for "DeprecatedModule". -module DeprecatedModule {-# DEPRECATED "Use \"Foo\" instead" #-} where - -foo :: Int -foo = 23 diff --git a/tests/html-tests/tests/DeprecatedModule.html.ref b/tests/html-tests/tests/DeprecatedModule.html.ref deleted file mode 100644 index 0ca4fafe..00000000 --- a/tests/html-tests/tests/DeprecatedModule.html.ref +++ /dev/null @@ -1,83 +0,0 @@ - -DeprecatedModule
      Safe HaskellNone

      DeprecatedModule

      Description

      Deprecated: Use Foo instead -

      Documentation for DeprecatedModule. -

      Documentation

      foo :: Int

      diff --git a/tests/html-tests/tests/DeprecatedModule2.hs b/tests/html-tests/tests/DeprecatedModule2.hs deleted file mode 100644 index 94185297..00000000 --- a/tests/html-tests/tests/DeprecatedModule2.hs +++ /dev/null @@ -1,4 +0,0 @@ -module DeprecatedModule2 {-# DEPRECATED "Use Foo instead" #-} where - -foo :: Int -foo = 23 diff --git a/tests/html-tests/tests/DeprecatedModule2.html.ref b/tests/html-tests/tests/DeprecatedModule2.html.ref deleted file mode 100644 index 0a313ae9..00000000 --- a/tests/html-tests/tests/DeprecatedModule2.html.ref +++ /dev/null @@ -1,76 +0,0 @@ - -DeprecatedModule2
      Safe HaskellNone

      DeprecatedModule2

      Description

      Deprecated: Use Foo instead -

      Documentation

      foo :: Int

      diff --git a/tests/html-tests/tests/DeprecatedNewtype.hs b/tests/html-tests/tests/DeprecatedNewtype.hs deleted file mode 100644 index 254f1f55..00000000 --- a/tests/html-tests/tests/DeprecatedNewtype.hs +++ /dev/null @@ -1,10 +0,0 @@ -module DeprecatedNewtype where - --- | some documentation -newtype SomeNewType = SomeNewTypeConst String {- ^ constructor docu -} -{-# DEPRECATED SomeNewType "SomeNewType" #-} -{-# DEPRECATED SomeNewTypeConst "SomeNewTypeConst" #-} - -newtype SomeOtherNewType = SomeOtherNewTypeConst String -{-# DEPRECATED SomeOtherNewType "SomeOtherNewType" #-} -{-# DEPRECATED SomeOtherNewTypeConst "SomeOtherNewTypeConst" #-} diff --git a/tests/html-tests/tests/DeprecatedNewtype.html.ref b/tests/html-tests/tests/DeprecatedNewtype.html.ref deleted file mode 100644 index 521ffb92..00000000 --- a/tests/html-tests/tests/DeprecatedNewtype.html.ref +++ /dev/null @@ -1,161 +0,0 @@ - -DeprecatedNewtype
      Safe HaskellNone

      DeprecatedNewtype

      Documentation

      newtype SomeNewType

      Deprecated: SomeNewType -

      some documentation -

      Constructors

      SomeNewTypeConst String

      Deprecated: SomeNewTypeConst -

      constructor docu -

      newtype SomeOtherNewType

      Deprecated: SomeOtherNewType -

      Constructors

      SomeOtherNewTypeConst String

      Deprecated: SomeOtherNewTypeConst -

      diff --git a/tests/html-tests/tests/DeprecatedReExport.hs b/tests/html-tests/tests/DeprecatedReExport.hs deleted file mode 100644 index f851e2ff..00000000 --- a/tests/html-tests/tests/DeprecatedReExport.hs +++ /dev/null @@ -1,16 +0,0 @@ --- | --- What is tested here: --- --- * Deprecation messages are shown for re-exported items. --- -module DeprecatedReExport ( --- * Re-exported from an other module - foo --- * Re-exported from an other package --- | Not yet working, see --- , isEmptyChan -, -) where - -import DeprecatedFunction -import Control.Concurrent.Chan diff --git a/tests/html-tests/tests/DeprecatedReExport.html.ref b/tests/html-tests/tests/DeprecatedReExport.html.ref deleted file mode 100644 index 611c181d..00000000 --- a/tests/html-tests/tests/DeprecatedReExport.html.ref +++ /dev/null @@ -1,133 +0,0 @@ - -DeprecatedReExport
      Safe HaskellNone

      DeprecatedReExport

      Description

      What is tested here: -

      • Deprecation messages are shown for re-exported items. -

      Synopsis

      Re-exported from an other module -

      foo :: Int

      Deprecated: use bar instead -

      some documentation for foo -

      Re-exported from an other package -

      Not yet working, see http://trac.haskell.org/haddock/ticket/223 - , isEmptyChan -

      diff --git a/tests/html-tests/tests/DeprecatedRecord.hs b/tests/html-tests/tests/DeprecatedRecord.hs deleted file mode 100644 index d44499e7..00000000 --- a/tests/html-tests/tests/DeprecatedRecord.hs +++ /dev/null @@ -1,9 +0,0 @@ -module DeprecatedRecord where - --- | type Foo -data Foo = Foo { - fooName :: String -- ^ some name -, fooValue :: Int -- ^ some value -} - -{-# DEPRECATED fooValue "do not use this" #-} diff --git a/tests/html-tests/tests/DeprecatedRecord.html.ref b/tests/html-tests/tests/DeprecatedRecord.html.ref deleted file mode 100644 index 9ade8377..00000000 --- a/tests/html-tests/tests/DeprecatedRecord.html.ref +++ /dev/null @@ -1,151 +0,0 @@ - -DeprecatedRecord
      Safe HaskellNone

      DeprecatedRecord

      Synopsis

      Documentation

      data Foo

      type Foo -

      Constructors

      Foo 

      Fields

      fooName :: String

      some name -

      fooValue :: Int

      Deprecated: do not use this -

      some value -

      diff --git a/tests/html-tests/tests/DeprecatedTypeFamily.hs b/tests/html-tests/tests/DeprecatedTypeFamily.hs deleted file mode 100644 index 70473bb8..00000000 --- a/tests/html-tests/tests/DeprecatedTypeFamily.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE TypeFamilies #-} -module DeprecatedTypeFamily where - --- | some documentation -data family SomeTypeFamily k :: * -> * -{-# DEPRECATED SomeTypeFamily "SomeTypeFamily" #-} - -data family SomeOtherTypeFamily k :: * -> * -{-# DEPRECATED SomeOtherTypeFamily "SomeOtherTypeFamily" #-} diff --git a/tests/html-tests/tests/DeprecatedTypeFamily.html.ref b/tests/html-tests/tests/DeprecatedTypeFamily.html.ref deleted file mode 100644 index ffc069a6..00000000 --- a/tests/html-tests/tests/DeprecatedTypeFamily.html.ref +++ /dev/null @@ -1,108 +0,0 @@ - -DeprecatedTypeFamily
      Safe HaskellNone

      DeprecatedTypeFamily

      Synopsis

      Documentation

      data family SomeTypeFamily k :: * -> *

      Deprecated: SomeTypeFamily -

      some documentation -

      data family SomeOtherTypeFamily k :: * -> *

      Deprecated: SomeOtherTypeFamily -

      diff --git a/tests/html-tests/tests/DeprecatedTypeSynonym.hs b/tests/html-tests/tests/DeprecatedTypeSynonym.hs deleted file mode 100644 index 34df47da..00000000 --- a/tests/html-tests/tests/DeprecatedTypeSynonym.hs +++ /dev/null @@ -1,9 +0,0 @@ - -module DeprecatedTypeSynonym where - --- | some documentation -type TypeSyn = String -{-# DEPRECATED TypeSyn "TypeSyn" #-} - -type OtherTypeSyn = String -{-# DEPRECATED OtherTypeSyn "OtherTypeSyn" #-} diff --git a/tests/html-tests/tests/DeprecatedTypeSynonym.html.ref b/tests/html-tests/tests/DeprecatedTypeSynonym.html.ref deleted file mode 100644 index 665dcf5d..00000000 --- a/tests/html-tests/tests/DeprecatedTypeSynonym.html.ref +++ /dev/null @@ -1,116 +0,0 @@ - -DeprecatedTypeSynonym
      Safe HaskellNone

      DeprecatedTypeSynonym

      Synopsis

      Documentation

      type TypeSyn = String

      Deprecated: TypeSyn -

      some documentation -

      type OtherTypeSyn = String

      Deprecated: OtherTypeSyn -

      diff --git a/tests/html-tests/tests/DeprecationMessageParseError.hs b/tests/html-tests/tests/DeprecationMessageParseError.hs deleted file mode 100644 index 2f8fb492..00000000 --- a/tests/html-tests/tests/DeprecationMessageParseError.hs +++ /dev/null @@ -1,12 +0,0 @@ --- | --- What is tested here: --- --- * If parsing of a deprecation message fails, the message is included --- verbatim. --- -module DeprecationMessageParseError where - --- | some documentation for foo -foo :: Int -foo = 23 -{-# DEPRECATED foo "use @bar instead" #-} diff --git a/tests/html-tests/tests/DeprecationMessageParseError.html.ref b/tests/html-tests/tests/DeprecationMessageParseError.html.ref deleted file mode 100644 index 75f9bf54..00000000 --- a/tests/html-tests/tests/DeprecationMessageParseError.html.ref +++ /dev/null @@ -1,101 +0,0 @@ - -DeprecationMessageParseError
      Safe HaskellNone

      DeprecationMessageParseError

      Description

      What is tested here: -

      • If parsing of a deprecation message fails, the message is included - verbatim. -

      Synopsis

      Documentation

      foo :: Int

      Deprecated: use @bar instead

      some documentation for foo -

      diff --git a/tests/html-tests/tests/Examples.hs b/tests/html-tests/tests/Examples.hs deleted file mode 100644 index c8c450f1..00000000 --- a/tests/html-tests/tests/Examples.hs +++ /dev/null @@ -1,39 +0,0 @@ -module Examples where - --- | Fibonacci number of given 'Integer'. --- --- Examples: --- --- >>> fib 5 --- 5 --- >>> fib 10 --- 55 --- --- >>> fib 10 --- 55 --- --- One more Example: --- --- >>> fib 5 --- 5 --- --- One more Example: --- --- >>> fib 5 --- 5 --- --- Example with an import: --- --- >>> import Data.Char --- >>> isSpace 'a' --- False --- --- >>> putStrLn "foo\n\nbar" --- foo --- --- bar --- -fib :: Integer -> Integer -fib 0 = 0 -fib 1 = 1 -fib n = fib (n - 1) + fib (n - 2) diff --git a/tests/html-tests/tests/Examples.html.ref b/tests/html-tests/tests/Examples.html.ref deleted file mode 100644 index 7ebe7770..00000000 --- a/tests/html-tests/tests/Examples.html.ref +++ /dev/null @@ -1,179 +0,0 @@ - -Examples
      Safe HaskellNone

      Examples

      Synopsis

      Documentation

      fib :: Integer -> Integer

      Fibonacci number of given Integer. -

      Examples: -

      >>> fib 5
      -5
      ->>> fib 10
      -55
      -
      >>> fib 10
      -55
      -

      One more Example: -

      >>> fib 5
      -5
      -

      One more Example: -

      >>> fib 5
      -5
      -

      Example with an import: -

      >>> import Data.Char
      ->>> isSpace 'a'
      -False
      -
      >>> putStrLn "foo\n\nbar"
      -foo
      -
      -bar
      -
      diff --git a/tests/html-tests/tests/FunArgs.hs b/tests/html-tests/tests/FunArgs.hs deleted file mode 100644 index b34d84b7..00000000 --- a/tests/html-tests/tests/FunArgs.hs +++ /dev/null @@ -1,16 +0,0 @@ -module FunArgs where - -f :: forall a. Ord a - => Int -- ^ First argument - -> a -- ^ Second argument - -> Bool -- ^ Third argument - -> (a -> a) -- ^ Fourth argument - -> () -- ^ Result -f = undefined - - -g :: a -- ^ First argument - -> b -- ^ Second argument - -> c -- ^ Third argument - -> d -- ^ Result -g = undefined diff --git a/tests/html-tests/tests/FunArgs.html.ref b/tests/html-tests/tests/FunArgs.html.ref deleted file mode 100644 index 6c87d1e6..00000000 --- a/tests/html-tests/tests/FunArgs.html.ref +++ /dev/null @@ -1,176 +0,0 @@ - -FunArgs
      Safe HaskellNone

      FunArgs

      Documentation

      f

      Arguments

      :: forall a . Ord a 
      => Int

      First argument -

      -> a

      Second argument -

      -> Bool

      Third argument -

      -> (a -> a)

      Fourth argument -

      -> ()

      Result -

      g

      Arguments

      :: a

      First argument -

      -> b

      Second argument -

      -> c

      Third argument -

      -> d

      Result -

      diff --git a/tests/html-tests/tests/GADTRecords.hs b/tests/html-tests/tests/GADTRecords.hs deleted file mode 100644 index c77810ad..00000000 --- a/tests/html-tests/tests/GADTRecords.hs +++ /dev/null @@ -1,12 +0,0 @@ -{-# LANGUAGE GADTs #-} -module GADTRecords (H1(..)) where - --- | h1 -data H1 a b where - C1 :: H1 a b - C2 :: Ord a => [a] -> H1 a a - C3 { field :: Int -- ^ hello docs - } :: H1 Int Int - C4 { field2 :: a -- ^ hello2 docs - } :: H1 Int a - diff --git a/tests/html-tests/tests/GADTRecords.html.ref b/tests/html-tests/tests/GADTRecords.html.ref deleted file mode 100644 index e3fcd2fe..00000000 --- a/tests/html-tests/tests/GADTRecords.html.ref +++ /dev/null @@ -1,234 +0,0 @@ - -GADTRecords
      Safe HaskellNone

      GADTRecords

      Synopsis

      Documentation

      data H1 a b where

      h1 -

      Constructors

      C1 :: H1 a b 
      C2 :: Ord a => [a] -> H1 a a 
      C3 :: Int -> H1 Int Int 

      Fields

      field :: Int

      hello docs -

      C4 :: a -> H1 Int a 

      Fields

      field2 :: a

      hello2 docs -

      diff --git a/tests/html-tests/tests/Hash.hs b/tests/html-tests/tests/Hash.hs deleted file mode 100644 index 343b69e9..00000000 --- a/tests/html-tests/tests/Hash.hs +++ /dev/null @@ -1,51 +0,0 @@ -{- | - Implementation of fixed-size hash tables, with a type - class for constructing hash values for structured types. --} -module Hash ( - -- * The @HashTable@ type - HashTable, - - -- ** Operations on @HashTable@s - new, insert, lookup, - - -- * The @Hash@ class - Hash(..), - ) where - -import Data.Array -import Prelude hiding (lookup) - --- | A hash table with keys of type @key@ and values of type @val@. --- The type @key@ should be an instance of 'Eq'. -data HashTable key val = HashTable Int (Array Int [(key,val)]) - --- | Builds a new hash table with a given size -new :: (Eq key, Hash key) => Int -> IO (HashTable key val) -new = undefined - --- | Inserts a new element into the hash table -insert :: (Eq key, Hash key) => key -> val -> IO () -insert = undefined - --- | Looks up a key in the hash table, returns @'Just' val@ if the key --- was found, or 'Nothing' otherwise. -lookup :: Hash key => key -> IO (Maybe val) -lookup = undefined - --- | A class of types which can be hashed. -class Hash a where - -- | hashes the value of type @a@ into an 'Int' - hash :: a -> Int - -instance Hash Int where - hash = id - -instance Hash Float where - hash = trunc - -instance (Hash a, Hash b) => Hash (a,b) where - hash (a,b) = hash a `xor` hash b - -trunc = undefined -xor = undefined diff --git a/tests/html-tests/tests/Hash.html.ref b/tests/html-tests/tests/Hash.html.ref deleted file mode 100644 index b0cd183c..00000000 --- a/tests/html-tests/tests/Hash.html.ref +++ /dev/null @@ -1,337 +0,0 @@ - -Hash
      Safe HaskellNone

      Hash

      Description

      Implementation of fixed-size hash tables, with a type - class for constructing hash values for structured types. -

      Synopsis

      The HashTable type -

      data HashTable key val

      A hash table with keys of type key and values of type val. - The type key should be an instance of Eq. -

      Operations on HashTables -

      new :: (Eq key, Hash key) => Int -> IO (HashTable key val)

      Builds a new hash table with a given size -

      insert :: (Eq key, Hash key) => key -> val -> IO ()

      Inserts a new element into the hash table -

      lookup :: Hash key => key -> IO (Maybe val)

      Looks up a key in the hash table, returns Just val if the key - was found, or Nothing otherwise. -

      The Hash class -

      class Hash a where

      A class of types which can be hashed. -

      Methods

      hash :: a -> Int

      hashes the value of type a into an Int -

      Instances

      Hash Float 
      Hash Int 
      (Hash a, Hash b) => Hash (a, b) 
      diff --git a/tests/html-tests/tests/Hidden.hs b/tests/html-tests/tests/Hidden.hs deleted file mode 100644 index 896da648..00000000 --- a/tests/html-tests/tests/Hidden.hs +++ /dev/null @@ -1,6 +0,0 @@ -{-# OPTIONS_HADDOCK hide #-} - -module Hidden where - -hidden :: Int -> Int -hidden a = a diff --git a/tests/html-tests/tests/HiddenInstances.hs b/tests/html-tests/tests/HiddenInstances.hs deleted file mode 100644 index 99a6c2fd..00000000 --- a/tests/html-tests/tests/HiddenInstances.hs +++ /dev/null @@ -1,35 +0,0 @@ --- http://trac.haskell.org/haddock/ticket/37 -module HiddenInstances (VisibleClass, VisibleData) where - --- | Should be visible -class VisibleClass a - --- | Should *not* be visible -class HiddenClass a - --- | Should *not* be visible -data HiddenData = HiddenData - --- | Should be visible -data VisibleData = VisibleData - --- | Should be visible -instance VisibleClass Int - --- | Should be visible -instance VisibleClass VisibleData - --- | Should be visible -instance Num VisibleData - --- | Should *not* be visible -instance VisibleClass HiddenData - --- | Should *not* be visible -instance HiddenClass Int - --- | Should *not* be visible -instance HiddenClass VisibleData - --- | Should *not* be visible -instance HiddenClass HiddenData diff --git a/tests/html-tests/tests/HiddenInstances.html.ref b/tests/html-tests/tests/HiddenInstances.html.ref deleted file mode 100644 index 999c114d..00000000 --- a/tests/html-tests/tests/HiddenInstances.html.ref +++ /dev/null @@ -1,169 +0,0 @@ - -HiddenInstances
      Safe HaskellNone

      HiddenInstances

      Synopsis

      Documentation

      class VisibleClass a

      Should be visible -

      Instances

      VisibleClass Int

      Should be visible -

      VisibleClass VisibleData

      Should be visible -

      data VisibleData

      Should be visible -

      Instances

      Num VisibleData

      Should be visible -

      VisibleClass VisibleData

      Should be visible -

      diff --git a/tests/html-tests/tests/HiddenInstancesA.hs b/tests/html-tests/tests/HiddenInstancesA.hs deleted file mode 100644 index f1775208..00000000 --- a/tests/html-tests/tests/HiddenInstancesA.hs +++ /dev/null @@ -1,17 +0,0 @@ -{-# OPTIONS_HADDOCK hide #-} -module HiddenInstancesA where - --- | Should be visible -class Foo a - --- | Should be visible -data Bar - --- | Should be visible -instance Foo Bar - --- | Should *not* be visible -data Baz - --- | Should *not* be visible -instance Foo Baz diff --git a/tests/html-tests/tests/HiddenInstancesB.hs b/tests/html-tests/tests/HiddenInstancesB.hs deleted file mode 100644 index eabf0637..00000000 --- a/tests/html-tests/tests/HiddenInstancesB.hs +++ /dev/null @@ -1,2 +0,0 @@ -module HiddenInstancesB (Foo, Bar) where -import HiddenInstancesA diff --git a/tests/html-tests/tests/HiddenInstancesB.html.ref b/tests/html-tests/tests/HiddenInstancesB.html.ref deleted file mode 100644 index 207a5146..00000000 --- a/tests/html-tests/tests/HiddenInstancesB.html.ref +++ /dev/null @@ -1,143 +0,0 @@ - -HiddenInstancesB
      Safe HaskellNone

      HiddenInstancesB

      Synopsis

      Documentation

      class Foo a

      Should be visible -

      Instances

      Foo Bar

      Should be visible -

      data Bar

      Should be visible -

      Instances

      Foo Bar

      Should be visible -

      diff --git a/tests/html-tests/tests/Hyperlinks.hs b/tests/html-tests/tests/Hyperlinks.hs deleted file mode 100644 index 34e64448..00000000 --- a/tests/html-tests/tests/Hyperlinks.hs +++ /dev/null @@ -1,8 +0,0 @@ -module Hyperlinks where - --- | --- A plain URL: --- --- A URL with a label: -foo :: Int -foo = 23 diff --git a/tests/html-tests/tests/Hyperlinks.html.ref b/tests/html-tests/tests/Hyperlinks.html.ref deleted file mode 100644 index e7351a63..00000000 --- a/tests/html-tests/tests/Hyperlinks.html.ref +++ /dev/null @@ -1,89 +0,0 @@ - -Hyperlinks
      Safe HaskellNone

      Hyperlinks

      Synopsis

      Documentation

      foo :: Int

      A plain URL: http://example.com/ -

      A URL with a label: some link -

      diff --git a/tests/html-tests/tests/IgnoreExports.hs b/tests/html-tests/tests/IgnoreExports.hs deleted file mode 100644 index 0321ad02..00000000 --- a/tests/html-tests/tests/IgnoreExports.hs +++ /dev/null @@ -1,10 +0,0 @@ -{-# OPTIONS_HADDOCK ignore-exports #-} -module IgnoreExports (foo) where - --- | documentation for foo -foo :: Int -foo = 23 - --- | documentation for bar -bar :: Int -bar = 23 diff --git a/tests/html-tests/tests/IgnoreExports.html.ref b/tests/html-tests/tests/IgnoreExports.html.ref deleted file mode 100644 index c661b48c..00000000 --- a/tests/html-tests/tests/IgnoreExports.html.ref +++ /dev/null @@ -1,101 +0,0 @@ - -IgnoreExports
      Safe HaskellNone

      IgnoreExports

      Synopsis

      Documentation

      foo :: Int

      documentation for foo -

      bar :: Int

      documentation for bar -

      diff --git a/tests/html-tests/tests/ModuleWithWarning.hs b/tests/html-tests/tests/ModuleWithWarning.hs deleted file mode 100644 index e64d9d7e..00000000 --- a/tests/html-tests/tests/ModuleWithWarning.hs +++ /dev/null @@ -1,5 +0,0 @@ --- | Documentation for "ModuleWithWarning". -module ModuleWithWarning {-# WARNING "This is an unstable interface. Prefer functions from \"Prelude\" instead!" #-} where - -foo :: Int -foo = 23 diff --git a/tests/html-tests/tests/ModuleWithWarning.html.ref b/tests/html-tests/tests/ModuleWithWarning.html.ref deleted file mode 100644 index 348f0822..00000000 --- a/tests/html-tests/tests/ModuleWithWarning.html.ref +++ /dev/null @@ -1,83 +0,0 @@ - -ModuleWithWarning
      Safe HaskellNone

      ModuleWithWarning

      Description

      Warning: This is an unstable interface. Prefer functions from Prelude instead! -

      Documentation for ModuleWithWarning. -

      Documentation

      foo :: Int

      diff --git a/tests/html-tests/tests/NamedDoc.hs b/tests/html-tests/tests/NamedDoc.hs deleted file mode 100644 index 7c04ba72..00000000 --- a/tests/html-tests/tests/NamedDoc.hs +++ /dev/null @@ -1,4 +0,0 @@ -module NamedDoc where - --- $foo bar - diff --git a/tests/html-tests/tests/NamedDoc.html.ref b/tests/html-tests/tests/NamedDoc.html.ref deleted file mode 100644 index d2b8ede1..00000000 --- a/tests/html-tests/tests/NamedDoc.html.ref +++ /dev/null @@ -1,68 +0,0 @@ - -NamedDoc
      Safe HaskellNone

      NamedDoc

      Synopsis

        Documentation

        bar -

        diff --git a/tests/html-tests/tests/NoLayout.hs b/tests/html-tests/tests/NoLayout.hs deleted file mode 100644 index 19b38b1d..00000000 --- a/tests/html-tests/tests/NoLayout.hs +++ /dev/null @@ -1,12 +0,0 @@ - --- Haddock comments are parsed as separate declarations so we --- need to insert a ';' when using them with explicit layout. --- This should probably be changed. - -module NoLayout where { - -- | the function 'g' - ; - g :: Int; - g = undefined - } - diff --git a/tests/html-tests/tests/NoLayout.html.ref b/tests/html-tests/tests/NoLayout.html.ref deleted file mode 100644 index 871add05..00000000 --- a/tests/html-tests/tests/NoLayout.html.ref +++ /dev/null @@ -1,86 +0,0 @@ - -NoLayout
        Safe HaskellNone

        NoLayout

        Synopsis

        Documentation

        g :: Int

        the function g -

        diff --git a/tests/html-tests/tests/NonGreedy.hs b/tests/html-tests/tests/NonGreedy.hs deleted file mode 100644 index f51b55f5..00000000 --- a/tests/html-tests/tests/NonGreedy.hs +++ /dev/null @@ -1,5 +0,0 @@ -module NonGreedy where - --- | -f :: a -f = undefined diff --git a/tests/html-tests/tests/NonGreedy.html.ref b/tests/html-tests/tests/NonGreedy.html.ref deleted file mode 100644 index 23d3f695..00000000 --- a/tests/html-tests/tests/NonGreedy.html.ref +++ /dev/null @@ -1,82 +0,0 @@ - -NonGreedy
        Safe HaskellNone

        NonGreedy

        Synopsis

        • f :: a

        Documentation

        f :: a

        diff --git a/tests/html-tests/tests/Properties.hs b/tests/html-tests/tests/Properties.hs deleted file mode 100644 index 05930ece..00000000 --- a/tests/html-tests/tests/Properties.hs +++ /dev/null @@ -1,9 +0,0 @@ -module Properties where - --- | Fibonacci number of given 'Integer'. --- --- prop> fib n <= fib (n + 1) -fib :: Integer -> Integer -fib 0 = 0 -fib 1 = 1 -fib n = fib (n - 1) + fib (n - 2) diff --git a/tests/html-tests/tests/Properties.html.ref b/tests/html-tests/tests/Properties.html.ref deleted file mode 100644 index 1c4ce893..00000000 --- a/tests/html-tests/tests/Properties.html.ref +++ /dev/null @@ -1,92 +0,0 @@ - -Properties
        Safe HaskellNone

        Properties

        Synopsis

        Documentation

        fib :: Integer -> Integer

        Fibonacci number of given Integer. -

        fib n <= fib (n + 1)
        diff --git a/tests/html-tests/tests/PruneWithWarning.hs b/tests/html-tests/tests/PruneWithWarning.hs deleted file mode 100644 index bfa55ea2..00000000 --- a/tests/html-tests/tests/PruneWithWarning.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# OPTIONS_HADDOCK prune #-} --- | --- What is tested here: --- --- * If a binding has a deprecation message but no documentation, it is pruned --- when @OPTIONS_HADDOCK prune@ is used. --- -module PruneWithWarning (foo, bar) where - -foo :: Int -foo = 23 -{-# DEPRECATED foo "use bar instead" #-} - -bar :: Int -bar = 42 diff --git a/tests/html-tests/tests/PruneWithWarning.html.ref b/tests/html-tests/tests/PruneWithWarning.html.ref deleted file mode 100644 index 3c31fbdf..00000000 --- a/tests/html-tests/tests/PruneWithWarning.html.ref +++ /dev/null @@ -1,72 +0,0 @@ - -PruneWithWarning
        Safe HaskellNone

        PruneWithWarning

        Description

        What is tested here: -

        • If a binding has a deprecation message but no documentation, it is pruned - when OPTIONS_HADDOCK prune is used. -
        diff --git a/tests/html-tests/tests/QuasiExpr.hs b/tests/html-tests/tests/QuasiExpr.hs deleted file mode 100644 index 970759ba..00000000 --- a/tests/html-tests/tests/QuasiExpr.hs +++ /dev/null @@ -1,34 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - --- Used by QuasiQuote. Example taken from the GHC documentation. -module QuasiExpr where - -import Language.Haskell.TH -import Language.Haskell.TH.Quote - -data Expr = IntExpr Integer - | AntiIntExpr String - | BinopExpr BinOp Expr Expr - | AntiExpr String - deriving Show - -data BinOp = AddOp - | SubOp - | MulOp - | DivOp - deriving Show - -eval :: Expr -> Integer -eval (IntExpr n) = n -eval (BinopExpr op x y) = (opToFun op) (eval x) (eval y) - where - opToFun AddOp = (+) - opToFun SubOp = (-) - opToFun MulOp = (*) - opToFun DivOp = div - -expr = QuasiQuoter parseExprExp undefined undefined undefined - --- cheating... -parseExprExp :: String -> Q Exp -parseExprExp _ = [| BinopExpr AddOp (IntExpr 1) (IntExpr 2) |] diff --git a/tests/html-tests/tests/QuasiExpr.html.ref b/tests/html-tests/tests/QuasiExpr.html.ref deleted file mode 100644 index 0a699f35..00000000 --- a/tests/html-tests/tests/QuasiExpr.html.ref +++ /dev/null @@ -1,221 +0,0 @@ - -QuasiExpr
        Safe HaskellNone

        QuasiExpr

        Documentation

        data BinOp

        Constructors

        AddOp 
        SubOp 
        MulOp 
        DivOp 

        Instances

        expr :: QuasiQuoter

        parseExprExp :: String -> Q Exp

        diff --git a/tests/html-tests/tests/QuasiQuote.hs b/tests/html-tests/tests/QuasiQuote.hs deleted file mode 100644 index 06762cf9..00000000 --- a/tests/html-tests/tests/QuasiQuote.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} - --- example taken from the GHC documentation -module QuasiQuote where - -import QuasiExpr - -val :: Integer -val = eval [expr|1 + 2|] diff --git a/tests/html-tests/tests/QuasiQuote.html.ref b/tests/html-tests/tests/QuasiQuote.html.ref deleted file mode 100644 index f61f2b84..00000000 --- a/tests/html-tests/tests/QuasiQuote.html.ref +++ /dev/null @@ -1,65 +0,0 @@ - -QuasiQuote
        Safe HaskellNone

        QuasiQuote

        Documentation

        diff --git a/tests/html-tests/tests/TH.hs b/tests/html-tests/tests/TH.hs deleted file mode 100644 index f8178bcb..00000000 --- a/tests/html-tests/tests/TH.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - -module TH where - -import Language.Haskell.TH - -decl :: Q [Dec] -decl = [d| f x = x|] diff --git a/tests/html-tests/tests/TH.html.ref b/tests/html-tests/tests/TH.html.ref deleted file mode 100644 index 086d6a4a..00000000 --- a/tests/html-tests/tests/TH.html.ref +++ /dev/null @@ -1,63 +0,0 @@ - -TH
        Safe HaskellNone

        TH

        Documentation

        decl :: Q [Dec]

        diff --git a/tests/html-tests/tests/TH2.hs b/tests/html-tests/tests/TH2.hs deleted file mode 100644 index ea85e547..00000000 --- a/tests/html-tests/tests/TH2.hs +++ /dev/null @@ -1,7 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - -module TH2 where - -import TH - -$( decl ) diff --git a/tests/html-tests/tests/TH2.html.ref b/tests/html-tests/tests/TH2.html.ref deleted file mode 100644 index 4d4a8914..00000000 --- a/tests/html-tests/tests/TH2.html.ref +++ /dev/null @@ -1,63 +0,0 @@ - -TH2
        Safe HaskellNone

        TH2

        Documentation

        f :: t -> t

        diff --git a/tests/html-tests/tests/Test.hs b/tests/html-tests/tests/Test.hs deleted file mode 100644 index d352f029..00000000 --- a/tests/html-tests/tests/Test.hs +++ /dev/null @@ -1,422 +0,0 @@ ------------------------------------------------------------------------------ --- | --- Module : Test --- Copyright : (c) Simon Marlow 2002 --- License : BSD-style --- --- Maintainer : libraries@haskell.org --- Stability : provisional --- Portability : portable --- --- This module illustrates & tests most of the features of Haddock. --- Testing references from the description: 'T', 'f', 'g', 'Visible.visible'. --- ------------------------------------------------------------------------------ - --- This is plain comment, ignored by Haddock. - -module Test ( - - -- Section headings are introduced with '-- *': - -- * Type declarations - - -- Subsection headings are introduced with '-- **' and so on. - -- ** Data types - T(..), T2, T3(..), T4(..), T5(..), T6(..), - N1(..), N2(..), N3(..), N4, N5(..), N6(..), N7(..), - - -- ** Records - R(..), R1(..), - - -- | test that we can export record selectors on their own: - p, q, u, - - -- * Class declarations - C(a,b), D(..), E, F(..), - - -- | Test that we can export a class method on its own: - a, - - -- * Function types - f, g, - - -- * Auxiliary stuff - - -- $aux1 - - -- $aux2 - - -- $aux3 - - -- $aux4 - - -- $aux5 - - -- $aux6 - - -- $aux7 - - -- $aux8 - - -- $aux9 - - -- $aux10 - - -- $aux11 - - -- $aux12 - - -- | This is some inline documentation in the export list - -- - -- > a code block using bird-tracks - -- > each line must begin with > (which isn't significant unless it - -- > is at the beginning of the line). - - -- * A hidden module - module Hidden, - - -- * A visible module - module Visible, - - {-| nested-style doc comments -} - - -- * Existential \/ Universal types - Ex(..), - - -- * Type signatures with argument docs - k, l, m, o, - - -- * A section - -- and without an intervening comma: - -- ** A subsection - -{-| - > a literal line - - $ a non /literal/ line $ --} - - f', - - withType, withoutType - ) where - -import Hidden -import Visible -import Data.Maybe - -bla = Nothing - --- | This comment applies to the /following/ declaration --- and it continues until the next non-comment line -data T a b - = A Int (Maybe Float) -- ^ This comment describes the 'A' constructor - | -- | This comment describes the 'B' constructor - B (T a b, T Int Float) -- ^ - --- | An abstract data declaration -data T2 a b = T2 a b - --- | A data declaration with no documentation annotations on the constructors -data T3 a b = A1 a | B1 b - --- A data declaration with no documentation annotations at all -data T4 a b = A2 a | B2 b - --- A data declaration documentation on the constructors only -data T5 a b - = A3 a -- ^ documents 'A3' - | B3 b -- ^ documents 'B3' - --- | Testing alternative comment styles -data T6 - -- | This is the doc for 'A4' - = A4 - | B4 - | -- ^ This is the doc for 'B4' - - -- | This is the doc for 'C4' - C4 - --- | A newtype -newtype N1 a = N1 a - --- | A newtype with a fieldname -newtype N2 a b = N2 {n :: a b} - --- | A newtype with a fieldname, documentation on the field -newtype N3 a b = N3 {n3 :: a b -- ^ this is the 'n3' field - } - --- | An abstract newtype - we show this one as data rather than newtype because --- the difference isn\'t visible to the programmer for an abstract type. -newtype N4 a b = N4 a - -newtype N5 a b = N5 {n5 :: a b -- ^ no docs on the datatype or the constructor - } - -newtype N6 a b = N6 {n6 :: a b - } - -- ^ docs on the constructor only - --- | docs on the newtype and the constructor -newtype N7 a b = N7 {n7 :: a b - } - -- ^ The 'N7' constructor - - -class (D a) => C a where - -- |this is a description of the 'a' method - a :: IO a - b :: [a] - -- ^ this is a description of the 'b' method - c :: a -- c is hidden in the export list - --- ^ This comment applies to the /previous/ declaration (the 'C' class) - -class D a where - d :: T a b - e :: (a,a) --- ^ This is a class declaration with no separate docs for the methods - -instance D Int where - d = undefined - e = undefined - --- instance with a qualified class name -instance Test.D Float where - d = undefined - e = undefined - -class E a where - ee :: a --- ^ This is a class declaration with no methods (or no methods exported) - --- This is a class declaration with no documentation at all -class F a where - ff :: a - --- | This is the documentation for the 'R' record, which has four fields, --- 'p', 'q', 'r', and 's'. -data R = - -- | This is the 'C1' record constructor, with the following fields: - C1 { p :: Int -- ^ This comment applies to the 'p' field - , q :: forall a . a->a -- ^ This comment applies to the 'q' field - , -- | This comment applies to both 'r' and 's' - r,s :: Int - } - | C2 { t :: T1 -> (T2 Int Int)-> (T3 Bool Bool) -> (T4 Float Float) -> T5 () (), - u,v :: Int - } - -- ^ This is the 'C2' record constructor, also with some fields: - --- | Testing different record commenting styles -data R1 - -- | This is the 'C3' record constructor - = C3 { - -- | The 's1' record selector - s1 :: Int - -- | The 's2' record selector - , s2 :: Int - , s3 :: Int -- NOTE: In the original examples/Test.hs in Haddock, there is an extra "," here. - -- Since GHC doesn't allow that, I have removed it in this file. - -- ^ The 's3' record selector - } - --- These section headers are only used when there is no export list to --- give the structure of the documentation: - --- * This is a section header (level 1) --- ** This is a section header (level 2) --- *** This is a section header (level 3) - -{-| -In a comment string we can refer to identifiers in scope with -single quotes like this: 'T', and we can refer to modules by -using double quotes: "Foo". We can add emphasis /like this/. - - * This is a bulleted list - - - This is the next item (different kind of bullet) - - (1) This is an ordered list - - 2. This is the next item (different kind of bullet) - - [cat] a small, furry, domesticated mammal - - [pineapple] a fruit grown in the tropics - -@ - This is a block of code, which can include other markup: 'R' - formatting - is - significant -@ - -> this is another block of code - -We can also include URLs in documentation: . --} - -f :: C a => a -> Int - --- | we can export foreign declarations too -foreign import ccall g :: Int -> IO CInt - --- | this doc string has a parse error in it: \' -h :: Int -h = 42 - - --- $aux1 This is some documentation that is attached to a name ($aux1) --- rather than a source declaration. The documentation may be --- referred to in the export list using its name. --- --- @ code block in named doc @ - --- $aux2 This is some documentation that is attached to a name ($aux2) - --- $aux3 --- @ code block on its own in named doc @ - --- $aux4 --- --- @ code block on its own in named doc (after newline) @ - -{- $aux5 a nested, named doc comment - - with a paragraph, - - @ and a code block @ --} - --- some tests for various arrangements of code blocks: - -{- $aux6 ->test ->test1 - -@ test2 - test3 -@ --} - -{- $aux7 -@ -test1 -test2 -@ --} - -{- $aux8 ->test3 ->test4 --} - -{- $aux9 -@ -test1 -test2 -@ - ->test3 ->test4 --} - -{- $aux10 ->test3 ->test4 - -@ -test1 -test2 -@ --} - --- This one is currently wrong (Haddock 0.4). The @...@ part is --- interpreted as part of the bird-tracked code block. -{- $aux11 -aux11: - ->test3 ->test4 - -@ -test1 -test2 -@ --} - --- $aux12 --- > foo --- --- > bar --- - --- | A data-type using existential\/universal types -data Ex a - = forall b . C b => Ex1 b - | forall b . Ex2 b - | forall b . C a => Ex3 b -- NOTE: I have added "forall b" here make GHC accept this file - | Ex4 (forall a . a -> a) - --- | This is a function with documentation for each argument -k :: T () () -- ^ This argument has type 'T' - -> (T2 Int Int) -- ^ This argument has type 'T2 Int Int' - -> (T3 Bool Bool -> T4 Float Float) -- ^ This argument has type @T3 Bool Bool -> T4 Float Float@ - -> T5 () () -- ^ This argument has a very long description that should - -- hopefully cause some wrapping to happen when it is finally - -- rendered by Haddock in the generated HTML page. - -> IO () -- ^ This is the result type - --- This function has arg docs but no docs for the function itself -l :: (Int, Int, Float) -- ^ takes a triple - -> Int -- ^ returns an 'Int' - --- | This function has some arg docs -m :: R - -> N1 () -- ^ one of the arguments - -> IO Int -- ^ and the return value - --- | This function has some arg docs but not a return value doc - --- can't use the original name ('n') with GHC -newn :: R -- ^ one of the arguments, an 'R' - -> N1 () -- ^ one of the arguments - -> IO Int -newn = undefined - - --- | A foreign import with argument docs -foreign import ccall unsafe - o :: Float -- ^ The input float - -> IO Float -- ^ The output float - --- | We should be able to escape this: \#\#\# - --- p :: Int --- can't use the above original definition with GHC -newp :: Int -newp = undefined - --- | a function with a prime can be referred to as 'f'' --- but f' doesn't get link'd 'f\'' -f' :: Int - --- | Comment on a definition without type signature -withoutType = undefined - --- | Comment on a definition with type signature -withType :: Int -withType = 1 - --- Add some definitions here so that this file can be compiled with GHC - -data T1 -f = undefined -f' = undefined -type CInt = Int -k = undefined -l = undefined -m = undefined diff --git a/tests/html-tests/tests/Test.html.ref b/tests/html-tests/tests/Test.html.ref deleted file mode 100644 index f2ef2b28..00000000 --- a/tests/html-tests/tests/Test.html.ref +++ /dev/null @@ -1,2245 +0,0 @@ - -Test
        Portabilityportable
        Stabilityprovisional
        Maintainerlibraries@haskell.org
        Safe HaskellNone

        Test

        Description

        This module illustrates & tests most of the features of Haddock. - Testing references from the description: T, f, g, visible. -

        Synopsis

        Type declarations -

        Data types -

        data T a b

        This comment applies to the following declaration - and it continues until the next non-comment line -

        Constructors

        A Int (Maybe Float)

        This comment describes the A constructor -

        B (T a b, T Int Float)

        This comment describes the B constructor -

        data T2 a b

        An abstract data declaration -

        data T3 a b

        A data declaration with no documentation annotations on the constructors -

        Constructors

        A1 a 
        B1 b 

        data T4 a b

        Constructors

        A2 a 
        B2 b 

        data T5 a b

        Constructors

        A3 a

        documents A3 -

        B3 b

        documents B3 -

        data T6

        Testing alternative comment styles -

        Constructors

        A4

        This is the doc for A4 -

        B4

        This is the doc for B4 -

        C4

        This is the doc for C4 -

        newtype N1 a

        A newtype -

        Constructors

        N1 a 

        newtype N2 a b

        A newtype with a fieldname -

        Constructors

        N2 

        Fields

        n :: a b
         

        newtype N3 a b

        A newtype with a fieldname, documentation on the field -

        Constructors

        N3 

        Fields

        n3 :: a b

        this is the n3 field -

        data N4 a b

        An abstract newtype - we show this one as data rather than newtype because - the difference isn't visible to the programmer for an abstract type. -

        newtype N5 a b

        Constructors

        N5 

        Fields

        n5 :: a b

        no docs on the datatype or the constructor -

        newtype N6 a b

        Constructors

        N6

        docs on the constructor only -

        Fields

        n6 :: a b
         

        newtype N7 a b

        docs on the newtype and the constructor -

        Constructors

        N7

        The N7 constructor -

        Fields

        n7 :: a b
         

        Records -

        data R

        This is the documentation for the R record, which has four fields, - p, q, r, and s. -

        Constructors

        C1

        This is the C1 record constructor, with the following fields: -

        Fields

        p :: Int

        This comment applies to the p field -

        q :: forall a. a -> a

        This comment applies to the q field -

        r :: Int

        This comment applies to both r and s -

        s :: Int

        This comment applies to both r and s -

        C2

        This is the C2 record constructor, also with some fields: -

        Fields

        t :: T1 -> T2 Int Int -> T3 Bool Bool -> T4 Float Float -> T5 () ()
         
        u :: Int
         
        v :: Int
         

        data R1

        Testing different record commenting styles -

        Constructors

        C3

        This is the C3 record constructor -

        Fields

        s1 :: Int

        The s1 record selector -

        s2 :: Int

        The s2 record selector -

        s3 :: Int

        The s3 record selector -

        test that we can export record selectors on their own: -

        Class declarations -

        class D a => C a where

        This comment applies to the previous declaration (the C class) -

        Methods

        a :: IO a

        this is a description of the a method -

        b :: [a]

        this is a description of the b method -

        class D a where

        This is a class declaration with no separate docs for the methods -

        Methods

        d :: T a b

        e :: (a, a)

        Instances

        class E a

        This is a class declaration with no methods (or no methods exported) -

        class F a where

        Methods

        ff :: a

        Test that we can export a class method on its own: -

        Function types -

        f :: C a => a -> Int

        In a comment string we can refer to identifiers in scope with -single quotes like this: T, and we can refer to modules by -using double quotes: Foo. We can add emphasis like this. -

        • This is a bulleted list -
        • This is the next item (different kind of bullet) -
        1. This is an ordered list -
        2. This is the next item (different kind of bullet) -
        cat
        a small, furry, domesticated mammal -
        pineapple
        a fruit grown in the tropics -
        -     This is a block of code, which can include other markup: R
        -     formatting
        -               is
        -                 significant
        -
         this is another block of code
        -

        We can also include URLs in documentation: http://www.haskell.org/. -

        g :: Int -> IO CInt

        we can export foreign declarations too -

        Auxiliary stuff -

        This is some documentation that is attached to a name ($aux1) - rather than a source declaration. The documentation may be - referred to in the export list using its name. -

         code block in named doc

        This is some documentation that is attached to a name ($aux2) -

         code block on its own in named doc
         code block on its own in named doc (after newline)

        a nested, named doc comment -

        with a paragraph, -

         and a code block
        test
        -test1
        -
         test2
        -  test3
        -
        -test1
        -test2
        -
        test3
        -test4
        -
        -test1
        -test2
        -
        test3
        -test4
        -
        test3
        -test4
        -
        -test1
        -test2
        -

        aux11: -

        test3
        -test4
        -
        -test1
        -test2
        -
         foo
        -
         bar
        -

        This is some inline documentation in the export list -

         a code block using bird-tracks
        - each line must begin with > (which isn't significant unless it
        - is at the beginning of the line).
        -

        A hidden module -

        hidden :: Int -> Int

        A visible module -

        module Visible

        nested-style doc comments -

        Existential / Universal types -

        data Ex a

        A data-type using existential/universal types -

        Constructors

        forall b . C b => Ex1 b 
        forall b . Ex2 b 
        forall b . C a => Ex3 b 
        Ex4 (forall a. a -> a) 

        Type signatures with argument docs -

        k

        Arguments

        :: T () ()

        This argument has type T -

        -> T2 Int Int

        This argument has type 'T2 Int Int' -

        -> (T3 Bool Bool -> T4 Float Float)

        This argument has type T3 Bool Bool -> T4 Float Float -

        -> T5 () ()

        This argument has a very long description that should - hopefully cause some wrapping to happen when it is finally - rendered by Haddock in the generated HTML page. -

        -> IO ()

        This is the result type -

        This is a function with documentation for each argument -

        l

        Arguments

        :: (Int, Int, Float)

        takes a triple -

        -> Int

        returns an Int -

        m

        Arguments

        :: R 
        -> N1 ()

        one of the arguments -

        -> IO Int

        and the return value -

        This function has some arg docs -

        o

        Arguments

        :: Float

        The input float -

        -> IO Float

        The output float -

        A foreign import with argument docs -

        A section -

        A subsection -

         a literal line
        -

        $ a non literal line $ -

        f' :: Int

        a function with a prime can be referred to as f' - but f' doesn't get link'd 'f\'' -

        withType :: Int

        Comment on a definition with type signature -

        withoutType :: a

        Comment on a definition without type signature -

        diff --git a/tests/html-tests/tests/Ticket112.hs b/tests/html-tests/tests/Ticket112.hs deleted file mode 100644 index c9cd5117..00000000 --- a/tests/html-tests/tests/Ticket112.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE MagicHash #-} - -module Ticket112 where - -import GHC.Prim - --- | ...given a raw 'Addr#' to the string, and the length of the string. -f :: a -f = undefined diff --git a/tests/html-tests/tests/Ticket112.html.ref b/tests/html-tests/tests/Ticket112.html.ref deleted file mode 100644 index c5c61703..00000000 --- a/tests/html-tests/tests/Ticket112.html.ref +++ /dev/null @@ -1,82 +0,0 @@ - -Ticket112
        Safe HaskellNone

        Ticket112

        Synopsis

        • f :: a

        Documentation

        f :: a

        ...given a raw Addr# to the string, and the length of the string. -

        diff --git a/tests/html-tests/tests/Ticket61.hs b/tests/html-tests/tests/Ticket61.hs deleted file mode 100644 index 26ca287f..00000000 --- a/tests/html-tests/tests/Ticket61.hs +++ /dev/null @@ -1,3 +0,0 @@ -module Ticket61 (module Ticket61_Hidden) where - -import Ticket61_Hidden diff --git a/tests/html-tests/tests/Ticket61.html.ref b/tests/html-tests/tests/Ticket61.html.ref deleted file mode 100644 index 8c22488b..00000000 --- a/tests/html-tests/tests/Ticket61.html.ref +++ /dev/null @@ -1,80 +0,0 @@ - -Ticket61
        Safe HaskellNone

        Ticket61

        Documentation

        class C a where

        Methods

        f :: a

        A comment about f -

        diff --git a/tests/html-tests/tests/Ticket61_Hidden.hs b/tests/html-tests/tests/Ticket61_Hidden.hs deleted file mode 100644 index 583c10cd..00000000 --- a/tests/html-tests/tests/Ticket61_Hidden.hs +++ /dev/null @@ -1,7 +0,0 @@ -{-# OPTIONS_HADDOCK hide #-} - -module Ticket61_Hidden where - -class C a where - -- | A comment about f - f :: a diff --git a/tests/html-tests/tests/Ticket75.hs b/tests/html-tests/tests/Ticket75.hs deleted file mode 100644 index 94a2f115..00000000 --- a/tests/html-tests/tests/Ticket75.hs +++ /dev/null @@ -1,7 +0,0 @@ -module Ticket75 where - -data a :- b = Q - --- | A reference to ':-' -f :: Int -f = undefined diff --git a/tests/html-tests/tests/Ticket75.html.ref b/tests/html-tests/tests/Ticket75.html.ref deleted file mode 100644 index cd510ea5..00000000 --- a/tests/html-tests/tests/Ticket75.html.ref +++ /dev/null @@ -1,116 +0,0 @@ - -Ticket75
        Safe HaskellNone

        Ticket75

        Synopsis

        Documentation

        data a :- b

        Constructors

        Q 

        f :: Int

        A reference to :- -

        diff --git a/tests/html-tests/tests/TypeFamilies.hs b/tests/html-tests/tests/TypeFamilies.hs deleted file mode 100644 index 561f95fd..00000000 --- a/tests/html-tests/tests/TypeFamilies.hs +++ /dev/null @@ -1,28 +0,0 @@ -{-# LANGUAGE TypeFamilies #-} - -module TypeFamilies where - --- | Type family G -type family G a :: * - --- | A class with an associated type -class A a where - -- | An associated type - data B a :: * -> * - -- | A method - f :: B a Int - --- | Doc for family -type family F a - - --- | Doc for G Int -type instance G Int = Bool -type instance G Float = Int - - -instance A Int where - data B Int x = Con x - f = Con 3 - -g = Con 5 diff --git a/tests/html-tests/tests/TypeFamilies.html.ref b/tests/html-tests/tests/TypeFamilies.html.ref deleted file mode 100644 index 196d60ec..00000000 --- a/tests/html-tests/tests/TypeFamilies.html.ref +++ /dev/null @@ -1,212 +0,0 @@ - -TypeFamilies
        Safe HaskellNone

        TypeFamilies

        Synopsis

        Documentation

        type family G a :: *

        Type family G -

        class A a where

        A class with an associated type -

        Associated Types

        data B a :: * -> *

        An associated type -

        Methods

        f :: B a Int

        A method -

        Instances

        A Int 

        type family F a

        Doc for family -

        diff --git a/tests/html-tests/tests/TypeOperators.hs b/tests/html-tests/tests/TypeOperators.hs deleted file mode 100644 index edbb9344..00000000 --- a/tests/html-tests/tests/TypeOperators.hs +++ /dev/null @@ -1,20 +0,0 @@ -{-# LANGUAGE TypeOperators #-} -module TypeOperators ( - -- * stuff - (:-:), - (:+:), - Op, - O(..), - biO, -) where - -data a :-: b - -data (a :+: b) c - -data a `Op` b - -newtype (g `O` f) a = O { unO :: g (f a) } - -biO :: (g `O` f) a -biO = undefined diff --git a/tests/html-tests/tests/TypeOperators.html.ref b/tests/html-tests/tests/TypeOperators.html.ref deleted file mode 100644 index 2b18727f..00000000 --- a/tests/html-tests/tests/TypeOperators.html.ref +++ /dev/null @@ -1,185 +0,0 @@ - -TypeOperators
        Safe HaskellNone

        TypeOperators

        Contents

        Synopsis

        • data a :-: b
        • data (a :+: b) c
        • data Op a b
        • newtype O g f a = O {}
        • biO :: (g `O` f) a

        stuff -

        data a :-: b

        data (a :+: b) c

        data Op a b

        newtype O g f a

        Constructors

        O 

        Fields

        unO :: g (f a)
         

        biO :: (g `O` f) a

        diff --git a/tests/html-tests/tests/Unicode.hs.disabled b/tests/html-tests/tests/Unicode.hs.disabled deleted file mode 100644 index d5bbf445..00000000 --- a/tests/html-tests/tests/Unicode.hs.disabled +++ /dev/null @@ -1,6 +0,0 @@ -module Unicode where - --- | γλώσσα -x :: Int -x = 1 - diff --git a/tests/html-tests/tests/Unicode.html.ref b/tests/html-tests/tests/Unicode.html.ref deleted file mode 100644 index 13ef6c1e..00000000 --- a/tests/html-tests/tests/Unicode.html.ref +++ /dev/null @@ -1,82 +0,0 @@ - -Unicode
        Safe HaskellNone

        Unicode

        Synopsis

        Documentation

        x :: Int

        γλώσσα -

        diff --git a/tests/html-tests/tests/Visible.hs b/tests/html-tests/tests/Visible.hs deleted file mode 100644 index cad71931..00000000 --- a/tests/html-tests/tests/Visible.hs +++ /dev/null @@ -1,3 +0,0 @@ -module Visible where -visible :: Int -> Int -visible a = a diff --git a/tests/html-tests/tests/Visible.html.ref b/tests/html-tests/tests/Visible.html.ref deleted file mode 100644 index de8b8d80..00000000 --- a/tests/html-tests/tests/Visible.html.ref +++ /dev/null @@ -1,67 +0,0 @@ - -Visible
        Safe HaskellNone

        Visible

        Documentation

        diff --git a/tests/html-tests/tests/frames.html.ref b/tests/html-tests/tests/frames.html.ref deleted file mode 100644 index 1b4e38d4..00000000 --- a/tests/html-tests/tests/frames.html.ref +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/tests/html-tests/tests/mini_A.html.ref b/tests/html-tests/tests/mini_A.html.ref deleted file mode 100644 index cbe50e41..00000000 --- a/tests/html-tests/tests/mini_A.html.ref +++ /dev/null @@ -1,59 +0,0 @@ - -A

        A

        diff --git a/tests/html-tests/tests/mini_AdvanceTypes.html.ref b/tests/html-tests/tests/mini_AdvanceTypes.html.ref deleted file mode 100644 index 59d8dcb1..00000000 --- a/tests/html-tests/tests/mini_AdvanceTypes.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -AdvanceTypes

        AdvanceTypes

        data Pattern

        diff --git a/tests/html-tests/tests/mini_B.html.ref b/tests/html-tests/tests/mini_B.html.ref deleted file mode 100644 index 211a7deb..00000000 --- a/tests/html-tests/tests/mini_B.html.ref +++ /dev/null @@ -1,45 +0,0 @@ - -B

        B

        diff --git a/tests/html-tests/tests/mini_Bug1.html.ref b/tests/html-tests/tests/mini_Bug1.html.ref deleted file mode 100644 index adf81c73..00000000 --- a/tests/html-tests/tests/mini_Bug1.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -Bug1

        Bug1

        data T

        diff --git a/tests/html-tests/tests/mini_Bug2.html.ref b/tests/html-tests/tests/mini_Bug2.html.ref deleted file mode 100644 index b673e459..00000000 --- a/tests/html-tests/tests/mini_Bug2.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Bug2

        Bug2

        diff --git a/tests/html-tests/tests/mini_Bug3.html.ref b/tests/html-tests/tests/mini_Bug3.html.ref deleted file mode 100644 index af4cc445..00000000 --- a/tests/html-tests/tests/mini_Bug3.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Bug3

        Bug3

        diff --git a/tests/html-tests/tests/mini_Bug4.html.ref b/tests/html-tests/tests/mini_Bug4.html.ref deleted file mode 100644 index b403e94a..00000000 --- a/tests/html-tests/tests/mini_Bug4.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Bug4

        Bug4

        diff --git a/tests/html-tests/tests/mini_Bug6.html.ref b/tests/html-tests/tests/mini_Bug6.html.ref deleted file mode 100644 index 5c5c1119..00000000 --- a/tests/html-tests/tests/mini_Bug6.html.ref +++ /dev/null @@ -1,65 +0,0 @@ - -Bug6

        Bug6

        data A

        data B

        data C

        data D

        data E

        diff --git a/tests/html-tests/tests/mini_Bug7.html.ref b/tests/html-tests/tests/mini_Bug7.html.ref deleted file mode 100644 index 1bec82ee..00000000 --- a/tests/html-tests/tests/mini_Bug7.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -Bug7

        Bug7

        data Foo

        class Bar x y

        diff --git a/tests/html-tests/tests/mini_Bug8.html.ref b/tests/html-tests/tests/mini_Bug8.html.ref deleted file mode 100644 index 070dbcf8..00000000 --- a/tests/html-tests/tests/mini_Bug8.html.ref +++ /dev/null @@ -1,63 +0,0 @@ - -Bug8

        Bug8

        diff --git a/tests/html-tests/tests/mini_BugDeprecated.html.ref b/tests/html-tests/tests/mini_BugDeprecated.html.ref deleted file mode 100644 index f0410137..00000000 --- a/tests/html-tests/tests/mini_BugDeprecated.html.ref +++ /dev/null @@ -1,61 +0,0 @@ - -BugDeprecated

        BugDeprecated

        diff --git a/tests/html-tests/tests/mini_BugExportHeadings.html.ref b/tests/html-tests/tests/mini_BugExportHeadings.html.ref deleted file mode 100644 index b481720d..00000000 --- a/tests/html-tests/tests/mini_BugExportHeadings.html.ref +++ /dev/null @@ -1,79 +0,0 @@ - -BugExportHeadings

        BugExportHeadings

        Foo -

        Bar -

        Baz -

        One -

        Two -

        Three -

        diff --git a/tests/html-tests/tests/mini_Bugs.html.ref b/tests/html-tests/tests/mini_Bugs.html.ref deleted file mode 100644 index 3c758375..00000000 --- a/tests/html-tests/tests/mini_Bugs.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -Bugs

        Bugs

        data A a

        diff --git a/tests/html-tests/tests/mini_CrossPackageDocs.html.ref b/tests/html-tests/tests/mini_CrossPackageDocs.html.ref deleted file mode 100644 index 4c0588ba..00000000 --- a/tests/html-tests/tests/mini_CrossPackageDocs.html.ref +++ /dev/null @@ -1,45 +0,0 @@ - -CrossPackageDocs

        CrossPackageDocs

        diff --git a/tests/html-tests/tests/mini_DeprecatedClass.html.ref b/tests/html-tests/tests/mini_DeprecatedClass.html.ref deleted file mode 100644 index 3923c1ff..00000000 --- a/tests/html-tests/tests/mini_DeprecatedClass.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -DeprecatedClass

        DeprecatedClass

        class SomeClass a

        diff --git a/tests/html-tests/tests/mini_DeprecatedData.html.ref b/tests/html-tests/tests/mini_DeprecatedData.html.ref deleted file mode 100644 index 8ef20113..00000000 --- a/tests/html-tests/tests/mini_DeprecatedData.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -DeprecatedData

        DeprecatedData

        data Foo

        data One

        diff --git a/tests/html-tests/tests/mini_DeprecatedFunction.html.ref b/tests/html-tests/tests/mini_DeprecatedFunction.html.ref deleted file mode 100644 index 9bb90dac..00000000 --- a/tests/html-tests/tests/mini_DeprecatedFunction.html.ref +++ /dev/null @@ -1,37 +0,0 @@ - -DeprecatedFunction

        DeprecatedFunction

        diff --git a/tests/html-tests/tests/mini_DeprecatedFunction2.html.ref b/tests/html-tests/tests/mini_DeprecatedFunction2.html.ref deleted file mode 100644 index a03991a9..00000000 --- a/tests/html-tests/tests/mini_DeprecatedFunction2.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -DeprecatedFunction2

        DeprecatedFunction2

        diff --git a/tests/html-tests/tests/mini_DeprecatedFunction3.html.ref b/tests/html-tests/tests/mini_DeprecatedFunction3.html.ref deleted file mode 100644 index 4ea60339..00000000 --- a/tests/html-tests/tests/mini_DeprecatedFunction3.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -DeprecatedFunction3

        DeprecatedFunction3

        diff --git a/tests/html-tests/tests/mini_DeprecatedModule.html.ref b/tests/html-tests/tests/mini_DeprecatedModule.html.ref deleted file mode 100644 index bfdef611..00000000 --- a/tests/html-tests/tests/mini_DeprecatedModule.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -DeprecatedModule

        DeprecatedModule

        diff --git a/tests/html-tests/tests/mini_DeprecatedModule2.html.ref b/tests/html-tests/tests/mini_DeprecatedModule2.html.ref deleted file mode 100644 index dbcc43b9..00000000 --- a/tests/html-tests/tests/mini_DeprecatedModule2.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -DeprecatedModule2

        DeprecatedModule2

        diff --git a/tests/html-tests/tests/mini_DeprecatedNewtype.html.ref b/tests/html-tests/tests/mini_DeprecatedNewtype.html.ref deleted file mode 100644 index a913525f..00000000 --- a/tests/html-tests/tests/mini_DeprecatedNewtype.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -DeprecatedNewtype

        DeprecatedNewtype

        diff --git a/tests/html-tests/tests/mini_DeprecatedReExport.html.ref b/tests/html-tests/tests/mini_DeprecatedReExport.html.ref deleted file mode 100644 index 8316dda5..00000000 --- a/tests/html-tests/tests/mini_DeprecatedReExport.html.ref +++ /dev/null @@ -1,37 +0,0 @@ - -DeprecatedReExport

        DeprecatedReExport

        Re-exported from an other module -

        Re-exported from an other package -

        diff --git a/tests/html-tests/tests/mini_DeprecatedRecord.html.ref b/tests/html-tests/tests/mini_DeprecatedRecord.html.ref deleted file mode 100644 index 3d949d2d..00000000 --- a/tests/html-tests/tests/mini_DeprecatedRecord.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -DeprecatedRecord

        DeprecatedRecord

        data Foo

        diff --git a/tests/html-tests/tests/mini_DeprecatedTypeFamily.html.ref b/tests/html-tests/tests/mini_DeprecatedTypeFamily.html.ref deleted file mode 100644 index c87d9637..00000000 --- a/tests/html-tests/tests/mini_DeprecatedTypeFamily.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -DeprecatedTypeFamily

        DeprecatedTypeFamily

        data family SomeTypeFamily k :: * -> *

        data family SomeOtherTypeFamily k :: * -> *

        diff --git a/tests/html-tests/tests/mini_DeprecatedTypeSynonym.html.ref b/tests/html-tests/tests/mini_DeprecatedTypeSynonym.html.ref deleted file mode 100644 index 5ade100d..00000000 --- a/tests/html-tests/tests/mini_DeprecatedTypeSynonym.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -DeprecatedTypeSynonym

        DeprecatedTypeSynonym

        diff --git a/tests/html-tests/tests/mini_DeprecationMessageParseError.html.ref b/tests/html-tests/tests/mini_DeprecationMessageParseError.html.ref deleted file mode 100644 index e52f487f..00000000 --- a/tests/html-tests/tests/mini_DeprecationMessageParseError.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -DeprecationMessageParseError

        DeprecationMessageParseError

        diff --git a/tests/html-tests/tests/mini_Examples.html.ref b/tests/html-tests/tests/mini_Examples.html.ref deleted file mode 100644 index c99c2c48..00000000 --- a/tests/html-tests/tests/mini_Examples.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Examples

        Examples

        diff --git a/tests/html-tests/tests/mini_FunArgs.html.ref b/tests/html-tests/tests/mini_FunArgs.html.ref deleted file mode 100644 index 89729720..00000000 --- a/tests/html-tests/tests/mini_FunArgs.html.ref +++ /dev/null @@ -1,37 +0,0 @@ - -FunArgs

        FunArgs

        diff --git a/tests/html-tests/tests/mini_GADTRecords.html.ref b/tests/html-tests/tests/mini_GADTRecords.html.ref deleted file mode 100644 index a8b838f0..00000000 --- a/tests/html-tests/tests/mini_GADTRecords.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -GADTRecords

        GADTRecords

        data H1 a b

        diff --git a/tests/html-tests/tests/mini_Hash.html.ref b/tests/html-tests/tests/mini_Hash.html.ref deleted file mode 100644 index 1e6ad1a9..00000000 --- a/tests/html-tests/tests/mini_Hash.html.ref +++ /dev/null @@ -1,74 +0,0 @@ - -Hash

        Hash

        The HashTable type -

        data HashTable key val

        Operations on HashTables -

        The Hash class -

        class Hash a

        diff --git a/tests/html-tests/tests/mini_HiddenInstances.html.ref b/tests/html-tests/tests/mini_HiddenInstances.html.ref deleted file mode 100644 index 0f1a2e04..00000000 --- a/tests/html-tests/tests/mini_HiddenInstances.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -HiddenInstances

        HiddenInstances

        diff --git a/tests/html-tests/tests/mini_HiddenInstancesB.html.ref b/tests/html-tests/tests/mini_HiddenInstancesB.html.ref deleted file mode 100644 index 3ce4f6a9..00000000 --- a/tests/html-tests/tests/mini_HiddenInstancesB.html.ref +++ /dev/null @@ -1,41 +0,0 @@ - -HiddenInstancesB

        HiddenInstancesB

        class Foo a

        data Bar

        diff --git a/tests/html-tests/tests/mini_Hyperlinks.html.ref b/tests/html-tests/tests/mini_Hyperlinks.html.ref deleted file mode 100644 index f0c7d65a..00000000 --- a/tests/html-tests/tests/mini_Hyperlinks.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Hyperlinks

        Hyperlinks

        diff --git a/tests/html-tests/tests/mini_IgnoreExports.html.ref b/tests/html-tests/tests/mini_IgnoreExports.html.ref deleted file mode 100644 index a420e65a..00000000 --- a/tests/html-tests/tests/mini_IgnoreExports.html.ref +++ /dev/null @@ -1,37 +0,0 @@ - -IgnoreExports

        IgnoreExports

        diff --git a/tests/html-tests/tests/mini_ModuleWithWarning.html.ref b/tests/html-tests/tests/mini_ModuleWithWarning.html.ref deleted file mode 100644 index 19315a14..00000000 --- a/tests/html-tests/tests/mini_ModuleWithWarning.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -ModuleWithWarning

        ModuleWithWarning

        diff --git a/tests/html-tests/tests/mini_NamedDoc.html.ref b/tests/html-tests/tests/mini_NamedDoc.html.ref deleted file mode 100644 index 066bbc61..00000000 --- a/tests/html-tests/tests/mini_NamedDoc.html.ref +++ /dev/null @@ -1,25 +0,0 @@ - -NamedDoc

        NamedDoc

        diff --git a/tests/html-tests/tests/mini_NoLayout.html.ref b/tests/html-tests/tests/mini_NoLayout.html.ref deleted file mode 100644 index 19562d70..00000000 --- a/tests/html-tests/tests/mini_NoLayout.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -NoLayout

        NoLayout

        diff --git a/tests/html-tests/tests/mini_NonGreedy.html.ref b/tests/html-tests/tests/mini_NonGreedy.html.ref deleted file mode 100644 index 698c368e..00000000 --- a/tests/html-tests/tests/mini_NonGreedy.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -NonGreedy

        NonGreedy

        diff --git a/tests/html-tests/tests/mini_Properties.html.ref b/tests/html-tests/tests/mini_Properties.html.ref deleted file mode 100644 index 5f538dfd..00000000 --- a/tests/html-tests/tests/mini_Properties.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Properties

        Properties

        diff --git a/tests/html-tests/tests/mini_PruneWithWarning.html.ref b/tests/html-tests/tests/mini_PruneWithWarning.html.ref deleted file mode 100644 index 9eb3aa00..00000000 --- a/tests/html-tests/tests/mini_PruneWithWarning.html.ref +++ /dev/null @@ -1,25 +0,0 @@ - -PruneWithWarning

        PruneWithWarning

        diff --git a/tests/html-tests/tests/mini_QuasiExpr.html.ref b/tests/html-tests/tests/mini_QuasiExpr.html.ref deleted file mode 100644 index 7dd9b829..00000000 --- a/tests/html-tests/tests/mini_QuasiExpr.html.ref +++ /dev/null @@ -1,59 +0,0 @@ - -QuasiExpr

        QuasiExpr

        diff --git a/tests/html-tests/tests/mini_QuasiQuote.html.ref b/tests/html-tests/tests/mini_QuasiQuote.html.ref deleted file mode 100644 index 5dac6acc..00000000 --- a/tests/html-tests/tests/mini_QuasiQuote.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -QuasiQuote

        QuasiQuote

        diff --git a/tests/html-tests/tests/mini_TH.html.ref b/tests/html-tests/tests/mini_TH.html.ref deleted file mode 100644 index d2ddbabc..00000000 --- a/tests/html-tests/tests/mini_TH.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -TH

        TH

        diff --git a/tests/html-tests/tests/mini_TH2.html.ref b/tests/html-tests/tests/mini_TH2.html.ref deleted file mode 100644 index 2c9f1340..00000000 --- a/tests/html-tests/tests/mini_TH2.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -TH2

        TH2

        diff --git a/tests/html-tests/tests/mini_Test.html.ref b/tests/html-tests/tests/mini_Test.html.ref deleted file mode 100644 index 26db2c0f..00000000 --- a/tests/html-tests/tests/mini_Test.html.ref +++ /dev/null @@ -1,269 +0,0 @@ - -Test

        Test

        Type declarations -

        Data types -

        data T a b

        data T2 a b

        data T3 a b

        data T4 a b

        data T5 a b

        data T6

        data N1 a

        data N2 a b

        data N3 a b

        data N4 a b

        data N5 a b

        data N6 a b

        data N7 a b

        Records -

        data R

        data R1

        Class declarations -

        class C a

        class D a

        class E a

        class F a

        Function types -

        Auxiliary stuff -

        A hidden module -

        A visible module -

        Existential / Universal types -

        data Ex a

        Type signatures with argument docs -

        A section -

        A subsection -

        diff --git a/tests/html-tests/tests/mini_Ticket112.html.ref b/tests/html-tests/tests/mini_Ticket112.html.ref deleted file mode 100644 index 68a0a5e5..00000000 --- a/tests/html-tests/tests/mini_Ticket112.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Ticket112

        Ticket112

        diff --git a/tests/html-tests/tests/mini_Ticket61.html.ref b/tests/html-tests/tests/mini_Ticket61.html.ref deleted file mode 100644 index a73fefca..00000000 --- a/tests/html-tests/tests/mini_Ticket61.html.ref +++ /dev/null @@ -1,33 +0,0 @@ - -Ticket61

        Ticket61

        class C a

        diff --git a/tests/html-tests/tests/mini_Ticket75.html.ref b/tests/html-tests/tests/mini_Ticket75.html.ref deleted file mode 100644 index 75ce882c..00000000 --- a/tests/html-tests/tests/mini_Ticket75.html.ref +++ /dev/null @@ -1,39 +0,0 @@ - -Ticket75

        Ticket75

        data a :- b

        diff --git a/tests/html-tests/tests/mini_TypeFamilies.html.ref b/tests/html-tests/tests/mini_TypeFamilies.html.ref deleted file mode 100644 index 0cf39c88..00000000 --- a/tests/html-tests/tests/mini_TypeFamilies.html.ref +++ /dev/null @@ -1,55 +0,0 @@ - -TypeFamilies

        TypeFamilies

        type family G a :: *

        class A a

        type family F a

        diff --git a/tests/html-tests/tests/mini_TypeOperators.html.ref b/tests/html-tests/tests/mini_TypeOperators.html.ref deleted file mode 100644 index 86b6beec..00000000 --- a/tests/html-tests/tests/mini_TypeOperators.html.ref +++ /dev/null @@ -1,66 +0,0 @@ - -TypeOperators

        TypeOperators

        stuff -

        data a :-: b

        data (a :+: b) c

        data Op a b

        data O g f a

        diff --git a/tests/html-tests/tests/mini_Unicode.html.ref b/tests/html-tests/tests/mini_Unicode.html.ref deleted file mode 100644 index 55336980..00000000 --- a/tests/html-tests/tests/mini_Unicode.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Unicode

        Unicode

        diff --git a/tests/html-tests/tests/mini_Visible.html.ref b/tests/html-tests/tests/mini_Visible.html.ref deleted file mode 100644 index 976a30c5..00000000 --- a/tests/html-tests/tests/mini_Visible.html.ref +++ /dev/null @@ -1,31 +0,0 @@ - -Visible

        Visible

        -- cgit v1.2.3 From d63c49537da8c2a3ee20e6153e2471087054730d Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Mon, 15 Oct 2012 14:25:39 +0200 Subject: Move unit tests to /test directory --- haddock.cabal | 4 +- test/Haddock/ParseSpec.hs | 81 ++++++++++++++++++++++ test/Spec.hs | 9 +++ test/nanospec/README | 6 ++ test/nanospec/Test/Hspec.hs | 126 ++++++++++++++++++++++++++++++++++ tests/nanospec/README | 6 -- tests/nanospec/Test/Hspec.hs | 126 ---------------------------------- tests/unit-tests/Haddock/ParseSpec.hs | 81 ---------------------- tests/unit-tests/Spec.hs | 9 --- 9 files changed, 224 insertions(+), 224 deletions(-) create mode 100644 test/Haddock/ParseSpec.hs create mode 100644 test/Spec.hs create mode 100644 test/nanospec/README create mode 100644 test/nanospec/Test/Hspec.hs delete mode 100644 tests/nanospec/README delete mode 100644 tests/nanospec/Test/Hspec.hs delete mode 100644 tests/unit-tests/Haddock/ParseSpec.hs delete mode 100644 tests/unit-tests/Spec.hs (limited to 'tests') diff --git a/haddock.cabal b/haddock.cabal index 36c016e9..8f655d83 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -181,8 +181,8 @@ test-suite spec default-language: Haskell2010 main-is: Spec.hs hs-source-dirs: - tests/unit-tests - , tests/nanospec + test + , test/nanospec , src build-depends: diff --git a/test/Haddock/ParseSpec.hs b/test/Haddock/ParseSpec.hs new file mode 100644 index 00000000..d692cb0c --- /dev/null +++ b/test/Haddock/ParseSpec.hs @@ -0,0 +1,81 @@ +{-# LANGUAGE OverloadedStrings, StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} +module Haddock.ParseSpec (main, spec) where + +import Test.Hspec +import RdrName (RdrName) +import DynFlags (DynFlags, defaultDynFlags) +import Haddock.Lex (tokenise) +import qualified Haddock.Parse as Parse +import Haddock.Types +import Outputable (Outputable, showSDoc, ppr) +import Data.Monoid +import Data.String + +dynFlags :: DynFlags +dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") + +instance Outputable a => Show a where + show = showSDoc dynFlags . ppr + +deriving instance Show a => Show (Doc a) +deriving instance Eq a =>Eq (Doc a) + +instance IsString (Doc RdrName) where + fromString = DocString + +parseParas :: String -> Maybe (Doc RdrName) +parseParas s = Parse.parseParas $ tokenise dynFlags s (0,0) + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "parseParas" $ do + it "parses a paragraph" $ do + parseParas "foobar" `shouldBe` Just (DocParagraph "foobar\n") + + context "when parsing an example" $ do + it "requires an example to be separated from a previous paragrap by an empty line" $ do + parseParas "foobar\n\n>>> fib 10\n55" `shouldBe` + Just (DocParagraph "foobar\n" <> DocExamples [Example "fib 10" ["55"]]) + + -- parse error + parseParas "foobar\n>>> fib 10\n55" `shouldBe` Nothing + + it "parses a result line that only contains as an emptly line" $ do + parseParas ">>> putFooBar\nfoo\n\nbar" `shouldBe` + Just (DocExamples [Example "putFooBar" ["foo","","bar"]]) + + context "when parsing a code block" $ do + it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do + parseParas "foobar\n\n> some code" `shouldBe` + Just (DocParagraph "foobar\n" <> DocCodeBlock " some code\n") + + -- parse error + parseParas "foobar\n> some code" `shouldBe` Nothing + + + context "when parsing a URL" $ do + it "parses a URL" $ do + parseParas "" `shouldBe` + Just (DocParagraph $ hyperlink "http://example.com/" Nothing <> "\n") + + it "accepts an optional label" $ do + parseParas "" `shouldBe` + Just (DocParagraph $ hyperlink "http://example.com/" (Just "some link") <> "\n") + + context "when parsing properties" $ do + it "can parse a single property" $ do + parseParas "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") + + it "can parse multiple subsequent properties" $ do + parseParas $ unlines [ + "prop> 23 == 23" + , "prop> 42 == 42" + ] + `shouldBe` Just (DocProperty "23 == 23" <> DocProperty "42 == 42") + where + hyperlink :: String -> Maybe String -> Doc RdrName + hyperlink url = DocHyperlink . Hyperlink url diff --git a/test/Spec.hs b/test/Spec.hs new file mode 100644 index 00000000..68521c03 --- /dev/null +++ b/test/Spec.hs @@ -0,0 +1,9 @@ +module Main where + +import Test.Hspec + +import qualified Haddock.ParseSpec + +main :: IO () +main = hspec $ do + describe "Haddock.Parse" Haddock.ParseSpec.spec diff --git a/test/nanospec/README b/test/nanospec/README new file mode 100644 index 00000000..ffce7c74 --- /dev/null +++ b/test/nanospec/README @@ -0,0 +1,6 @@ +A lightweight implementation of a subset of Hspec's API with minimal +dependencies. + +http://hackage.haskell.org/package/nanospec + +This is a copy of version 0.1.0. diff --git a/test/nanospec/Test/Hspec.hs b/test/nanospec/Test/Hspec.hs new file mode 100644 index 00000000..904ce2e0 --- /dev/null +++ b/test/nanospec/Test/Hspec.hs @@ -0,0 +1,126 @@ +{-# LANGUAGE DeriveDataTypeable, CPP #-} +-- | A lightweight implementation of a subset of Hspec's API. +module Test.Hspec ( +-- * Types + SpecM +, Spec + +-- * Defining a spec +, describe +, context +, it + +-- ** Setting expectations +, Expectation +, expect +, shouldBe +, shouldReturn + +-- * Running a spec +, hspec +) where + +import Control.Applicative +import Control.Monad +import Data.Monoid +import Data.List (intercalate) +import Data.Typeable +import qualified Control.Exception as E +import System.Exit + +-- a writer monad +data SpecM a = SpecM a [SpecTree] + +add :: SpecTree -> SpecM () +add s = SpecM () [s] + +instance Monad SpecM where + return a = SpecM a [] + SpecM a xs >>= f = case f a of + SpecM b ys -> SpecM b (xs ++ ys) + +data SpecTree = SpecGroup String Spec + | SpecExample String (IO Result) + +data Result = Success | Failure String + deriving (Eq, Show) + +type Spec = SpecM () + +describe :: String -> Spec -> Spec +describe label = add . SpecGroup label + +context :: String -> Spec -> Spec +context = describe + +it :: String -> Expectation -> Spec +it label = add . SpecExample label . evaluateExpectation + +-- | Summary of a test run. +data Summary = Summary Int Int + +instance Monoid Summary where + mempty = Summary 0 0 + (Summary x1 x2) `mappend` (Summary y1 y2) = Summary (x1 + y1) (x2 + y2) + +runSpec :: Spec -> IO Summary +runSpec = runForrest [] + where + runForrest :: [String] -> Spec -> IO Summary + runForrest labels (SpecM () xs) = mconcat <$> mapM (runTree labels) xs + + runTree :: [String] -> SpecTree -> IO Summary + runTree labels spec = case spec of + SpecExample label x -> do + putStr $ "/" ++ (intercalate "/" . reverse) (label:labels) ++ "/ " + r <- x + case r of + Success -> do + putStrLn "OK" + return (Summary 1 0) + Failure err -> do + putStrLn "FAILED" + putStrLn err + return (Summary 1 1) + SpecGroup label xs -> do + runForrest (label:labels) xs + +hspec :: Spec -> IO () +hspec spec = do + Summary total failures <- runSpec spec + putStrLn (show total ++ " example(s), " ++ show failures ++ " failure(s)") + when (failures /= 0) exitFailure + +type Expectation = IO () + +infix 1 `shouldBe`, `shouldReturn` + +shouldBe :: (Show a, Eq a) => a -> a -> Expectation +actual `shouldBe` expected = + expect ("expected: " ++ show expected ++ "\n but got: " ++ show actual) (actual == expected) + +shouldReturn :: (Show a, Eq a) => IO a -> a -> Expectation +action `shouldReturn` expected = action >>= (`shouldBe` expected) + +expect :: String -> Bool -> Expectation +expect label f + | f = return () + | otherwise = E.throwIO (ExpectationFailure label) + +data ExpectationFailure = ExpectationFailure String + deriving (Show, Eq, Typeable) + +instance E.Exception ExpectationFailure + +evaluateExpectation :: Expectation -> IO Result +evaluateExpectation action = (action >> return Success) + `E.catches` [ + -- Re-throw AsyncException, otherwise execution will not terminate on SIGINT + -- (ctrl-c). All AsyncExceptions are re-thrown (not just UserInterrupt) + -- because all of them indicate severe conditions and should not occur during + -- normal operation. + E.Handler $ \e -> E.throw (e :: E.AsyncException) + + , E.Handler $ \(ExpectationFailure err) -> return (Failure err) + , E.Handler $ \e -> (return . Failure) ("*** Exception: " ++ show (e :: E.SomeException)) + ] diff --git a/tests/nanospec/README b/tests/nanospec/README deleted file mode 100644 index ffce7c74..00000000 --- a/tests/nanospec/README +++ /dev/null @@ -1,6 +0,0 @@ -A lightweight implementation of a subset of Hspec's API with minimal -dependencies. - -http://hackage.haskell.org/package/nanospec - -This is a copy of version 0.1.0. diff --git a/tests/nanospec/Test/Hspec.hs b/tests/nanospec/Test/Hspec.hs deleted file mode 100644 index 904ce2e0..00000000 --- a/tests/nanospec/Test/Hspec.hs +++ /dev/null @@ -1,126 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable, CPP #-} --- | A lightweight implementation of a subset of Hspec's API. -module Test.Hspec ( --- * Types - SpecM -, Spec - --- * Defining a spec -, describe -, context -, it - --- ** Setting expectations -, Expectation -, expect -, shouldBe -, shouldReturn - --- * Running a spec -, hspec -) where - -import Control.Applicative -import Control.Monad -import Data.Monoid -import Data.List (intercalate) -import Data.Typeable -import qualified Control.Exception as E -import System.Exit - --- a writer monad -data SpecM a = SpecM a [SpecTree] - -add :: SpecTree -> SpecM () -add s = SpecM () [s] - -instance Monad SpecM where - return a = SpecM a [] - SpecM a xs >>= f = case f a of - SpecM b ys -> SpecM b (xs ++ ys) - -data SpecTree = SpecGroup String Spec - | SpecExample String (IO Result) - -data Result = Success | Failure String - deriving (Eq, Show) - -type Spec = SpecM () - -describe :: String -> Spec -> Spec -describe label = add . SpecGroup label - -context :: String -> Spec -> Spec -context = describe - -it :: String -> Expectation -> Spec -it label = add . SpecExample label . evaluateExpectation - --- | Summary of a test run. -data Summary = Summary Int Int - -instance Monoid Summary where - mempty = Summary 0 0 - (Summary x1 x2) `mappend` (Summary y1 y2) = Summary (x1 + y1) (x2 + y2) - -runSpec :: Spec -> IO Summary -runSpec = runForrest [] - where - runForrest :: [String] -> Spec -> IO Summary - runForrest labels (SpecM () xs) = mconcat <$> mapM (runTree labels) xs - - runTree :: [String] -> SpecTree -> IO Summary - runTree labels spec = case spec of - SpecExample label x -> do - putStr $ "/" ++ (intercalate "/" . reverse) (label:labels) ++ "/ " - r <- x - case r of - Success -> do - putStrLn "OK" - return (Summary 1 0) - Failure err -> do - putStrLn "FAILED" - putStrLn err - return (Summary 1 1) - SpecGroup label xs -> do - runForrest (label:labels) xs - -hspec :: Spec -> IO () -hspec spec = do - Summary total failures <- runSpec spec - putStrLn (show total ++ " example(s), " ++ show failures ++ " failure(s)") - when (failures /= 0) exitFailure - -type Expectation = IO () - -infix 1 `shouldBe`, `shouldReturn` - -shouldBe :: (Show a, Eq a) => a -> a -> Expectation -actual `shouldBe` expected = - expect ("expected: " ++ show expected ++ "\n but got: " ++ show actual) (actual == expected) - -shouldReturn :: (Show a, Eq a) => IO a -> a -> Expectation -action `shouldReturn` expected = action >>= (`shouldBe` expected) - -expect :: String -> Bool -> Expectation -expect label f - | f = return () - | otherwise = E.throwIO (ExpectationFailure label) - -data ExpectationFailure = ExpectationFailure String - deriving (Show, Eq, Typeable) - -instance E.Exception ExpectationFailure - -evaluateExpectation :: Expectation -> IO Result -evaluateExpectation action = (action >> return Success) - `E.catches` [ - -- Re-throw AsyncException, otherwise execution will not terminate on SIGINT - -- (ctrl-c). All AsyncExceptions are re-thrown (not just UserInterrupt) - -- because all of them indicate severe conditions and should not occur during - -- normal operation. - E.Handler $ \e -> E.throw (e :: E.AsyncException) - - , E.Handler $ \(ExpectationFailure err) -> return (Failure err) - , E.Handler $ \e -> (return . Failure) ("*** Exception: " ++ show (e :: E.SomeException)) - ] diff --git a/tests/unit-tests/Haddock/ParseSpec.hs b/tests/unit-tests/Haddock/ParseSpec.hs deleted file mode 100644 index d692cb0c..00000000 --- a/tests/unit-tests/Haddock/ParseSpec.hs +++ /dev/null @@ -1,81 +0,0 @@ -{-# LANGUAGE OverloadedStrings, StandaloneDeriving, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} -{-# OPTIONS_GHC -fno-warn-orphans #-} -module Haddock.ParseSpec (main, spec) where - -import Test.Hspec -import RdrName (RdrName) -import DynFlags (DynFlags, defaultDynFlags) -import Haddock.Lex (tokenise) -import qualified Haddock.Parse as Parse -import Haddock.Types -import Outputable (Outputable, showSDoc, ppr) -import Data.Monoid -import Data.String - -dynFlags :: DynFlags -dynFlags = defaultDynFlags (error "dynFlags for Haddock tests: undefined") - -instance Outputable a => Show a where - show = showSDoc dynFlags . ppr - -deriving instance Show a => Show (Doc a) -deriving instance Eq a =>Eq (Doc a) - -instance IsString (Doc RdrName) where - fromString = DocString - -parseParas :: String -> Maybe (Doc RdrName) -parseParas s = Parse.parseParas $ tokenise dynFlags s (0,0) - -main :: IO () -main = hspec spec - -spec :: Spec -spec = do - describe "parseParas" $ do - it "parses a paragraph" $ do - parseParas "foobar" `shouldBe` Just (DocParagraph "foobar\n") - - context "when parsing an example" $ do - it "requires an example to be separated from a previous paragrap by an empty line" $ do - parseParas "foobar\n\n>>> fib 10\n55" `shouldBe` - Just (DocParagraph "foobar\n" <> DocExamples [Example "fib 10" ["55"]]) - - -- parse error - parseParas "foobar\n>>> fib 10\n55" `shouldBe` Nothing - - it "parses a result line that only contains as an emptly line" $ do - parseParas ">>> putFooBar\nfoo\n\nbar" `shouldBe` - Just (DocExamples [Example "putFooBar" ["foo","","bar"]]) - - context "when parsing a code block" $ do - it "requires a code blocks to be separated from a previous paragrap by an empty line" $ do - parseParas "foobar\n\n> some code" `shouldBe` - Just (DocParagraph "foobar\n" <> DocCodeBlock " some code\n") - - -- parse error - parseParas "foobar\n> some code" `shouldBe` Nothing - - - context "when parsing a URL" $ do - it "parses a URL" $ do - parseParas "" `shouldBe` - Just (DocParagraph $ hyperlink "http://example.com/" Nothing <> "\n") - - it "accepts an optional label" $ do - parseParas "" `shouldBe` - Just (DocParagraph $ hyperlink "http://example.com/" (Just "some link") <> "\n") - - context "when parsing properties" $ do - it "can parse a single property" $ do - parseParas "prop> 23 == 23" `shouldBe` Just (DocProperty "23 == 23") - - it "can parse multiple subsequent properties" $ do - parseParas $ unlines [ - "prop> 23 == 23" - , "prop> 42 == 42" - ] - `shouldBe` Just (DocProperty "23 == 23" <> DocProperty "42 == 42") - where - hyperlink :: String -> Maybe String -> Doc RdrName - hyperlink url = DocHyperlink . Hyperlink url diff --git a/tests/unit-tests/Spec.hs b/tests/unit-tests/Spec.hs deleted file mode 100644 index 68521c03..00000000 --- a/tests/unit-tests/Spec.hs +++ /dev/null @@ -1,9 +0,0 @@ -module Main where - -import Test.Hspec - -import qualified Haddock.ParseSpec - -main :: IO () -main = hspec $ do - describe "Haddock.Parse" Haddock.ParseSpec.spec -- cgit v1.2.3