diff options
Diffstat (limited to 'html-test')
69 files changed, 614 insertions, 268 deletions
diff --git a/html-test/Main.hs b/html-test/Main.hs new file mode 100755 index 00000000..3880fc3c --- /dev/null +++ b/html-test/Main.hs @@ -0,0 +1,51 @@ +{-# LANGUAGE CPP #-} + + +import Data.Char + +import System.Environment +import System.FilePath + +import Test.Haddock +import Test.Haddock.Xhtml + + +checkConfig :: CheckConfig Xml +checkConfig = CheckConfig + { ccfgRead = \mdl input -> stripIfRequired mdl <$> parseXml input + , ccfgDump = dumpXml + , ccfgEqual = (==) + } + + +dirConfig :: DirConfig +dirConfig = (defaultDirConfig $ takeDirectory __FILE__) + { dcfgCheckIgnore = checkIgnore + } + + +main :: IO () +main = do + cfg <- parseArgs checkConfig dirConfig =<< getArgs + runAndCheck $ cfg + { cfgHaddockArgs = cfgHaddockArgs cfg ++ ["--pretty-html", "--html"] + } + + +stripIfRequired :: String -> Xml -> Xml +stripIfRequired mdl = + stripLinks' . stripFooter + where + stripLinks' + | mdl `elem` preserveLinksModules = id + | otherwise = stripLinks + + +-- | List of modules in which we don't 'stripLinks' +preserveLinksModules :: [String] +preserveLinksModules = ["Bug253"] + + +checkIgnore :: FilePath -> Bool +checkIgnore file@(c:_) | takeExtension file == ".html" && isUpper c = False +checkIgnore _ = True diff --git a/html-test/README.markdown b/html-test/README.markdown deleted file mode 100644 index 717bac5c..00000000 --- a/html-test/README.markdown +++ /dev/null @@ -1,27 +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 `html-test/src` directory. - - 2. Run `cabal test`. You should now have `html-test/out/<modulename>.html`. - The test passes since there is no reference file to compare with. - - 3. To make a reference file from the output file, run - - html-test/accept.lhs <modulename> - -Tips and tricks: - -To "accept" all output files (copy them to reference files), run - - runhaskell accept.lhs - -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.lhs b/html-test/accept.lhs deleted file mode 100755 index f6dfc4cd..00000000 --- a/html-test/accept.lhs +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env runhaskell -\begin{code} -{-# LANGUAGE CPP #-} -import System.Cmd -import System.Environment -import System.FilePath -import System.Directory -import Data.List -import Control.Applicative - -baseDir = takeDirectory __FILE__ - -main :: IO () -main = do - contents <- filter (not . ignore) <$> getDirectoryContents (baseDir </> "out") - args <- getArgs - if not $ null args then - mapM_ copy [ baseDir </> "out" </> file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] - else - mapM_ copy [ baseDir </> "out" </> file | file <- contents] - where - ignore = - foldr (liftA2 (||)) (const False) [ - (== ".") - , (== "..") - , (isPrefixOf "index") - , (isPrefixOf "doc-index") - ] - -copy :: FilePath -> IO () -copy file = do - let new = baseDir </> "ref" </> takeFileName file - if ".html" `isSuffixOf` file then do - putStrLn (file ++ " -> " ++ new) - stripLinks <$> readFile file >>= writeFile new - else do - -- copy css, images, etc. - copyFile file new - -stripLinks :: String -> String -stripLinks str = - let prefix = "<a href=\"" in - case stripPrefix prefix str of - Just str' -> prefix ++ stripLinks (dropWhile (/= '"') str') - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs -\end{code} diff --git a/html-test/ref/Bug387.html b/html-test/ref/Bug387.html index 7b605fd0..80735916 100644 --- a/html-test/ref/Bug387.html +++ b/html-test/ref/Bug387.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();setSynopsis("mini_Bug387.html");}; diff --git a/html-test/ref/Math.html b/html-test/ref/Math.html new file mode 100644 index 00000000..5b76fd13 --- /dev/null +++ b/html-test/ref/Math.html @@ -0,0 +1,103 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><title + >Math</title + ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" + /><script src="haddock-util.js" type="text/javascript" + ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ><script type="text/javascript" + >//<![CDATA[ +window.onload = function () {pageLoad();setSynopsis("mini_Math.html");}; +//]]> +</script + ></head + ><body + ><div id="package-header" + ><ul class="links" id="page-menu" + ><li + ><a href="" + >Contents</a + ></li + ><li + ><a href="" + >Index</a + ></li + ></ul + ><p class="caption empty" + > </p + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe</td + ></tr + ></table + ><p class="caption" + >Math</p + ></div + ><div id="description" + ><p class="caption" + >Description</p + ><div class="doc" + ><p + >Math (display) for <code + >normalDensity</code + ></p + ><p + >\[ + \int_{-\infty}^{\infty} e^{-x^2/2} = \sqrt{2\pi} + \]</p + ><p + >\(\int_{-\infty}^{\infty} e^{-x^2/2} = \sqrt{2\pi}\)</p + ></div + ></div + ><div id="synopsis" + ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')" + >Synopsis</p + ><ul id="section.syn" class="hide" onclick="toggleSection('syn')" + ><li class="src short" + ><a href="" + >f</a + > :: <a href="" + >Integer</a + ></li + ></ul + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><a name="v:f" class="def" + >f</a + > :: <a href="" + >Integer</a + ></p + ><div class="doc" + ><p + >Math (inline) for <code + >normalDensity</code + > + \(\int_{-\infty}^{\infty} e^{-x^2/2} = \sqrt{2\pi}\) + \[\int_{-\infty}^{\infty} e^{-x^2/2} = \sqrt{2\pi}\]</p + ></div + ></div + ></div + ></div + ><div id="footer" + ><p + >Produced by <a href="" + >Haddock</a + > version 2.16.1</p + ></div + ></body + ></html +> diff --git a/html-test/ref/OrphanInstances.html b/html-test/ref/OrphanInstances.html new file mode 100644 index 00000000..0f12bb2e --- /dev/null +++ b/html-test/ref/OrphanInstances.html @@ -0,0 +1,113 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><title + >OrphanInstances</title + ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" + /><script src="haddock-util.js" type="text/javascript" + ></script + ><script type="text/javascript" + >//<![CDATA[ +window.onload = function () {pageLoad();setSynopsis("mini_OrphanInstances.html");}; +//]]> +</script + ></head + ><body + ><div id="package-header" + ><ul class="links" id="page-menu" + ><li + ><a href="index.html" + >Contents</a + ></li + ><li + ><a href="doc-index.html" + >Index</a + ></li + ></ul + ><p class="caption empty" + > </p + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe</td + ></tr + ></table + ><p class="caption" + >OrphanInstances</p + ></div + ><div id="table-of-contents" + ><p class="caption" + >Contents</p + ><ul + ><li + ><a href="#section.orphans" + >Orphan instances</a + ></li + ></ul + ></div + ><div id="synopsis" + ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')" + >Synopsis</p + ><ul id="section.syn" class="hide" onclick="toggleSection('syn')" + ></ul + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><h1 + >Orphan instances</h1 + ><div id="section.orphans" class="show" + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span id="control.i:o:ic:AClass:AClass:1" class="instance expander" onclick="toggleSection('i:o:ic:AClass:AClass:1')" + ></span + > <a href="OrphanInstancesClass.html#t:AClass" + >AClass</a + > <a href="OrphanInstancesType.html#t:AType" + >AType</a + ></span + ></td + ><td class="doc" + ><p + >This is an orphan instance.</p + ></td + ></tr + ><tr + ><td colspan="2" + ><div id="section.i:o:ic:AClass:AClass:1" class="inst-details hide" + ><div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#v:aClass" + >aClass</a + > :: <a href="OrphanInstancesType.html#t:AType" + >AType</a + > -> <a href="/opt/exp/ghc/roots/landing/share/doc/ghc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int" + >Int</a + ></p + ></div + ></div + ></td + ></tr + ></table + ></div + ></div + ></div + ><div id="footer" + ><p + >Produced by <a href="http://www.haskell.org/haddock/" + >Haddock</a + > version 2.16.2</p + ></div + ></body + ></html +> diff --git a/html-test/ref/OrphanInstancesClass.html b/html-test/ref/OrphanInstancesClass.html new file mode 100644 index 00000000..69ba33f8 --- /dev/null +++ b/html-test/ref/OrphanInstancesClass.html @@ -0,0 +1,85 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><title + >OrphanInstancesClass</title + ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" + /><script src="haddock-util.js" type="text/javascript" + ></script + ><script type="text/javascript" + >//<![CDATA[ +window.onload = function () {pageLoad();setSynopsis("mini_OrphanInstancesClass.html");}; +//]]> +</script + ></head + ><body + ><div id="package-header" + ><ul class="links" id="page-menu" + ><li + ><a href="index.html" + >Contents</a + ></li + ><li + ><a href="doc-index.html" + >Index</a + ></li + ></ul + ><p class="caption empty" + > </p + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe</td + ></tr + ></table + ><p class="caption" + >OrphanInstancesClass</p + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >class</span + > <a href="#t:AClass" id="t:AClass" class="def" + >AClass</a + > a <span class="keyword" + >where</span + ></p + ><div class="subs minimal" + ><p class="caption" + >Minimal complete definition</p + ><p class="src" + ><a href="OrphanInstancesClass.html#v:aClass" + >aClass</a + ></p + ></div + ><div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#v:aClass" id="v:aClass" class="def" + >aClass</a + > :: a -> <a href="/opt/exp/ghc/roots/landing/share/doc/ghc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int" + >Int</a + ></p + ></div + ></div + ></div + ></div + ><div id="footer" + ><p + >Produced by <a href="http://www.haskell.org/haddock/" + >Haddock</a + > version 2.16.2</p + ></div + ></body + ></html +> diff --git a/html-test/ref/OrphanInstancesType.html b/html-test/ref/OrphanInstancesType.html new file mode 100644 index 00000000..2652db73 --- /dev/null +++ b/html-test/ref/OrphanInstancesType.html @@ -0,0 +1,81 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><title + >OrphanInstancesType</title + ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" + /><script src="haddock-util.js" type="text/javascript" + ></script + ><script type="text/javascript" + >//<![CDATA[ +window.onload = function () {pageLoad();setSynopsis("mini_OrphanInstancesType.html");}; +//]]> +</script + ></head + ><body + ><div id="package-header" + ><ul class="links" id="page-menu" + ><li + ><a href="index.html" + >Contents</a + ></li + ><li + ><a href="doc-index.html" + >Index</a + ></li + ></ul + ><p class="caption empty" + > </p + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe</td + ></tr + ></table + ><p class="caption" + >OrphanInstancesType</p + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >data</span + > <a href="#t:AType" id="t:AType" class="def" + >AType</a + ></p + ><div class="subs constructors" + ><p class="caption" + >Constructors</p + ><table + ><tr + ><td class="src" + ><a href="#v:AType" id="v:AType" class="def" + >AType</a + > <a href="/opt/exp/ghc/roots/landing/share/doc/ghc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int" + >Int</a + ></td + ><td class="doc empty" + > </td + ></tr + ></table + ></div + ></div + ></div + ></div + ><div id="footer" + ><p + >Produced by <a href="http://www.haskell.org/haddock/" + >Haddock</a + > version 2.16.2</p + ></div + ></body + ></html +> diff --git a/html-test/ref/mini_A.html b/html-test/ref/mini_A.html index c3d36935..6f914440 100644 --- a/html-test/ref/mini_A.html +++ b/html-test/ref/mini_A.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_AdvanceTypes.html b/html-test/ref/mini_AdvanceTypes.html index c4b0806a..f72502dd 100644 --- a/html-test/ref/mini_AdvanceTypes.html +++ b/html-test/ref/mini_AdvanceTypes.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_B.html b/html-test/ref/mini_B.html index 9b3ef381..557d5dfe 100644 --- a/html-test/ref/mini_B.html +++ b/html-test/ref/mini_B.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Bug1.html b/html-test/ref/mini_Bug1.html index bab3748c..01a65c6f 100644 --- a/html-test/ref/mini_Bug1.html +++ b/html-test/ref/mini_Bug1.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Bug2.html b/html-test/ref/mini_Bug2.html index b673e459..4cbea53d 100644 --- a/html-test/ref/mini_Bug2.html +++ b/html-test/ref/mini_Bug2.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Bug3.html b/html-test/ref/mini_Bug3.html index af4cc445..9f46a9e6 100644 --- a/html-test/ref/mini_Bug3.html +++ b/html-test/ref/mini_Bug3.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Bug4.html b/html-test/ref/mini_Bug4.html index b403e94a..cfc489b4 100644 --- a/html-test/ref/mini_Bug4.html +++ b/html-test/ref/mini_Bug4.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Bug6.html b/html-test/ref/mini_Bug6.html index e448e7a3..cea7a09d 100644 --- a/html-test/ref/mini_Bug6.html +++ b/html-test/ref/mini_Bug6.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Bug7.html b/html-test/ref/mini_Bug7.html index 2cb7ebe1..3c32e012 100644 --- a/html-test/ref/mini_Bug7.html +++ b/html-test/ref/mini_Bug7.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Bug8.html b/html-test/ref/mini_Bug8.html index ca6ec68a..63770a6d 100644 --- a/html-test/ref/mini_Bug8.html +++ b/html-test/ref/mini_Bug8.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_BugDeprecated.html b/html-test/ref/mini_BugDeprecated.html index 9c8fc229..5a075ca8 100644 --- a/html-test/ref/mini_BugDeprecated.html +++ b/html-test/ref/mini_BugDeprecated.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_BugExportHeadings.html b/html-test/ref/mini_BugExportHeadings.html index e170b41a..2a1223e6 100644 --- a/html-test/ref/mini_BugExportHeadings.html +++ b/html-test/ref/mini_BugExportHeadings.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Bugs.html b/html-test/ref/mini_Bugs.html index 3c758375..6c7eefe7 100644 --- a/html-test/ref/mini_Bugs.html +++ b/html-test/ref/mini_Bugs.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedClass.html b/html-test/ref/mini_DeprecatedClass.html index 3923c1ff..05889033 100644 --- a/html-test/ref/mini_DeprecatedClass.html +++ b/html-test/ref/mini_DeprecatedClass.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedData.html b/html-test/ref/mini_DeprecatedData.html index 7f11afeb..6dad3417 100644 --- a/html-test/ref/mini_DeprecatedData.html +++ b/html-test/ref/mini_DeprecatedData.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedFunction.html b/html-test/ref/mini_DeprecatedFunction.html index 9bb90dac..1564c916 100644 --- a/html-test/ref/mini_DeprecatedFunction.html +++ b/html-test/ref/mini_DeprecatedFunction.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedFunction2.html b/html-test/ref/mini_DeprecatedFunction2.html index a03991a9..8af6fa90 100644 --- a/html-test/ref/mini_DeprecatedFunction2.html +++ b/html-test/ref/mini_DeprecatedFunction2.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedFunction3.html b/html-test/ref/mini_DeprecatedFunction3.html index 4ea60339..61819fc8 100644 --- a/html-test/ref/mini_DeprecatedFunction3.html +++ b/html-test/ref/mini_DeprecatedFunction3.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedModule.html b/html-test/ref/mini_DeprecatedModule.html index bfdef611..112d70df 100644 --- a/html-test/ref/mini_DeprecatedModule.html +++ b/html-test/ref/mini_DeprecatedModule.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedModule2.html b/html-test/ref/mini_DeprecatedModule2.html index dbcc43b9..18dc9b2d 100644 --- a/html-test/ref/mini_DeprecatedModule2.html +++ b/html-test/ref/mini_DeprecatedModule2.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedNewtype.html b/html-test/ref/mini_DeprecatedNewtype.html index 84d41828..22b56d10 100644 --- a/html-test/ref/mini_DeprecatedNewtype.html +++ b/html-test/ref/mini_DeprecatedNewtype.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedReExport.html b/html-test/ref/mini_DeprecatedReExport.html index 405926b1..b1600cb7 100644 --- a/html-test/ref/mini_DeprecatedReExport.html +++ b/html-test/ref/mini_DeprecatedReExport.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedRecord.html b/html-test/ref/mini_DeprecatedRecord.html index 54dc9722..5da974e7 100644 --- a/html-test/ref/mini_DeprecatedRecord.html +++ b/html-test/ref/mini_DeprecatedRecord.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedTypeFamily.html b/html-test/ref/mini_DeprecatedTypeFamily.html index c87d9637..eb90e152 100644 --- a/html-test/ref/mini_DeprecatedTypeFamily.html +++ b/html-test/ref/mini_DeprecatedTypeFamily.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_DeprecatedTypeSynonym.html b/html-test/ref/mini_DeprecatedTypeSynonym.html index c04c374f..4ea068d9 100644 --- a/html-test/ref/mini_DeprecatedTypeSynonym.html +++ b/html-test/ref/mini_DeprecatedTypeSynonym.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Examples.html b/html-test/ref/mini_Examples.html index c99c2c48..16769ed2 100644 --- a/html-test/ref/mini_Examples.html +++ b/html-test/ref/mini_Examples.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_FunArgs.html b/html-test/ref/mini_FunArgs.html index eac6c8fe..952e6879 100644 --- a/html-test/ref/mini_FunArgs.html +++ b/html-test/ref/mini_FunArgs.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_GADTRecords.html b/html-test/ref/mini_GADTRecords.html index a8b838f0..fe0c5753 100644 --- a/html-test/ref/mini_GADTRecords.html +++ b/html-test/ref/mini_GADTRecords.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Hash.html b/html-test/ref/mini_Hash.html index a0a68840..6647caf7 100644 --- a/html-test/ref/mini_Hash.html +++ b/html-test/ref/mini_Hash.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_HiddenInstances.html b/html-test/ref/mini_HiddenInstances.html index 01bab320..5e709de7 100644 --- a/html-test/ref/mini_HiddenInstances.html +++ b/html-test/ref/mini_HiddenInstances.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_HiddenInstancesB.html b/html-test/ref/mini_HiddenInstancesB.html index e02b42b1..8c8b832c 100644 --- a/html-test/ref/mini_HiddenInstancesB.html +++ b/html-test/ref/mini_HiddenInstancesB.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Hyperlinks.html b/html-test/ref/mini_Hyperlinks.html index f0c7d65a..5071b876 100644 --- a/html-test/ref/mini_Hyperlinks.html +++ b/html-test/ref/mini_Hyperlinks.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_IgnoreExports.html b/html-test/ref/mini_IgnoreExports.html index a420e65a..498b8507 100644 --- a/html-test/ref/mini_IgnoreExports.html +++ b/html-test/ref/mini_IgnoreExports.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Math.html b/html-test/ref/mini_Math.html new file mode 100644 index 00000000..e7f0f14f --- /dev/null +++ b/html-test/ref/mini_Math.html @@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><title + >Math</title + ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" + /><script src="haddock-util.js" type="text/javascript" + ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ><script type="text/javascript" + >//<![CDATA[ +window.onload = function () {pageLoad();}; +//]]> +</script + ></head + ><body id="mini" + ><div id="module-header" + ><p class="caption" + >Math</p + ></div + ><div id="interface" + ><div class="top" + ><p class="src" + ><a href="" target="main" + >f</a + ></p + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/mini_ModuleWithWarning.html b/html-test/ref/mini_ModuleWithWarning.html index 19315a14..ebe78e11 100644 --- a/html-test/ref/mini_ModuleWithWarning.html +++ b/html-test/ref/mini_ModuleWithWarning.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_NamedDoc.html b/html-test/ref/mini_NamedDoc.html index 066bbc61..58ba3f53 100644 --- a/html-test/ref/mini_NamedDoc.html +++ b/html-test/ref/mini_NamedDoc.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_NoLayout.html b/html-test/ref/mini_NoLayout.html index 19562d70..74878965 100644 --- a/html-test/ref/mini_NoLayout.html +++ b/html-test/ref/mini_NoLayout.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_NonGreedy.html b/html-test/ref/mini_NonGreedy.html index 698c368e..96c51c75 100644 --- a/html-test/ref/mini_NonGreedy.html +++ b/html-test/ref/mini_NonGreedy.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Properties.html b/html-test/ref/mini_Properties.html index 5f538dfd..8362d16e 100644 --- a/html-test/ref/mini_Properties.html +++ b/html-test/ref/mini_Properties.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_PruneWithWarning.html b/html-test/ref/mini_PruneWithWarning.html index 9eb3aa00..e73dc510 100644 --- a/html-test/ref/mini_PruneWithWarning.html +++ b/html-test/ref/mini_PruneWithWarning.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_QuasiExpr.html b/html-test/ref/mini_QuasiExpr.html index 06797498..f9e8b7b5 100644 --- a/html-test/ref/mini_QuasiExpr.html +++ b/html-test/ref/mini_QuasiExpr.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_QuasiQuote.html b/html-test/ref/mini_QuasiQuote.html index 5dac6acc..e0d8e22e 100644 --- a/html-test/ref/mini_QuasiQuote.html +++ b/html-test/ref/mini_QuasiQuote.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_SpuriousSuperclassConstraints.html b/html-test/ref/mini_SpuriousSuperclassConstraints.html index 22079a4e..38be01c4 100644 --- a/html-test/ref/mini_SpuriousSuperclassConstraints.html +++ b/html-test/ref/mini_SpuriousSuperclassConstraints.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_TH.html b/html-test/ref/mini_TH.html index d2ddbabc..51b35ee5 100644 --- a/html-test/ref/mini_TH.html +++ b/html-test/ref/mini_TH.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_TH2.html b/html-test/ref/mini_TH2.html index 2c9f1340..767e6e2c 100644 --- a/html-test/ref/mini_TH2.html +++ b/html-test/ref/mini_TH2.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Test.html b/html-test/ref/mini_Test.html index 7453387c..3fd26035 100644 --- a/html-test/ref/mini_Test.html +++ b/html-test/ref/mini_Test.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Ticket112.html b/html-test/ref/mini_Ticket112.html index 68a0a5e5..d6f23ea2 100644 --- a/html-test/ref/mini_Ticket112.html +++ b/html-test/ref/mini_Ticket112.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Ticket61.html b/html-test/ref/mini_Ticket61.html index a73fefca..6c061b7e 100644 --- a/html-test/ref/mini_Ticket61.html +++ b/html-test/ref/mini_Ticket61.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Ticket75.html b/html-test/ref/mini_Ticket75.html index 75ce882c..351a4d16 100644 --- a/html-test/ref/mini_Ticket75.html +++ b/html-test/ref/mini_Ticket75.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_TitledPicture.html b/html-test/ref/mini_TitledPicture.html index 760566e5..91f61ef3 100644 --- a/html-test/ref/mini_TitledPicture.html +++ b/html-test/ref/mini_TitledPicture.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_TypeFamilies.html b/html-test/ref/mini_TypeFamilies.html index feb61abc..9c6e02ea 100644 --- a/html-test/ref/mini_TypeFamilies.html +++ b/html-test/ref/mini_TypeFamilies.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_TypeOperators.html b/html-test/ref/mini_TypeOperators.html index ce31643e..61a01103 100644 --- a/html-test/ref/mini_TypeOperators.html +++ b/html-test/ref/mini_TypeOperators.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Unicode.html b/html-test/ref/mini_Unicode.html index 55336980..820cd80d 100644 --- a/html-test/ref/mini_Unicode.html +++ b/html-test/ref/mini_Unicode.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/ref/mini_Visible.html b/html-test/ref/mini_Visible.html index 976a30c5..d51d755a 100644 --- a/html-test/ref/mini_Visible.html +++ b/html-test/ref/mini_Visible.html @@ -7,6 +7,8 @@ ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript" ></script + ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script ><script type="text/javascript" >//<![CDATA[ window.onload = function () {pageLoad();}; diff --git a/html-test/run b/html-test/run new file mode 100755 index 00000000..3e72be80 --- /dev/null +++ b/html-test/run @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +export HADDOCK_PATH=$(which haddock) +LIB_PATH="$(dirname "$BASH_SOURCE")/../haddock-test/src/" +MAIN_PATH="$(dirname "$BASH_SOURCE")/Main.hs" +runhaskell -i:"$LIB_PATH" $MAIN_PATH $@ diff --git a/html-test/run.lhs b/html-test/run.lhs deleted file mode 100755 index 1f19b723..00000000 --- a/html-test/run.lhs +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/env runhaskell -\begin{code} -{-# LANGUAGE CPP #-} -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.Directory -import System.Environment -import System.Exit -import System.FilePath -import System.Process (ProcessHandle, runProcess, waitForProcess, system) - -packageRoot, dataDir, haddockPath, baseDir, testDir, outDir :: FilePath -baseDir = takeDirectory __FILE__ -testDir = baseDir </> "src" -refDir = baseDir </> "ref" -outDir = baseDir </> "out" -packageRoot = baseDir </> ".." -dataDir = packageRoot </> "resources" -haddockPath = packageRoot </> "dist" </> "build" </> "haddock" </> "haddock" - - -main :: IO () -main = do - test - putStrLn "All tests passed!" - - -test :: IO () -test = do - x <- doesFileExist haddockPath - unless x $ System.Exit.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", Main.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=-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 = refDir </> dropExtension mod ++ ".html" - b <- doesFileExist reffile - if b - then do - out <- readFile outfile - ref <- readFile reffile - if not $ haddockEq (outfile, out) (reffile, ref) - then do - putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" - let ref' = maybeStripLinks outfile ref - out' = maybeStripLinks reffile out - let reffile' = outDir </> takeFileName reffile ++ ".nolinks" - outfile' = outDir </> takeFileName outfile ++ ".ref.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)" - --- | List of modules in which we don't 'stripLinks' -preserveLinksModules :: [String] -preserveLinksModules = map (++ ".html") ["Bug253"] - --- | A rather nasty way to drop the Haddock version string from the --- end of the generated HTML files so that we don't have to change --- every single test every time we change versions. We rely on the the --- last paragraph of the document to be the version. We end up with --- malformed HTML but we don't care as we never look at it ourselves. -dropVersion :: String -> String -dropVersion = reverse . dropTillP . reverse - where - dropTillP [] = [] - dropTillP ('p':'<':xs) = xs - dropTillP (_:xs) = dropTillP xs - -haddockEq :: (FilePath, String) -> (FilePath, String) -> Bool -haddockEq (fn1, file1) (fn2, file2) = - maybeStripLinks fn1 (dropVersion file1) - == maybeStripLinks fn2 (dropVersion file2) - -maybeStripLinks :: String -- ^ Module we're considering for stripping - -> String -> String -maybeStripLinks m = if any (`isSuffixOf` m) preserveLinksModules - then id - else stripLinks - -stripLinks :: String -> String -stripLinks str = - let prefix = "<a href=\"" in - case stripPrefix prefix str of - Just str' -> case dropWhile (/= '>') (dropWhile (/= '"') str') of - [] -> [] - x:xs -> stripLinks (stripHrefEnd xs) - Nothing -> - case str of - [] -> [] - x : xs -> x : stripLinks xs - -stripHrefEnd :: String -> String -stripHrefEnd s = - let pref = "</a" in - case stripPrefix pref s of - Just str' -> case dropWhile (/= '>') str' of - [] -> [] - x:xs -> xs - Nothing -> - case s of - [] -> [] - x : xs -> x : stripHrefEnd xs - -programOnPath :: FilePath -> IO Bool -programOnPath p = do - result <- findProgramLocation silent p - return (isJust result) -\end{code} diff --git a/html-test/src/Math.hs b/html-test/src/Math.hs new file mode 100644 index 00000000..75bc513e --- /dev/null +++ b/html-test/src/Math.hs @@ -0,0 +1,14 @@ +-- | Math (display) for 'normalDensity' +-- +-- \[ +-- \int_{-\infty}^{\infty} e^{-x^2/2} = \sqrt{2\pi} +-- \] +-- +-- \(\int_{-\infty}^{\infty} e^{-x^2/2} = \sqrt{2\pi}\) + +module Math where + +-- | Math (inline) for 'normalDensity' +-- \(\int_{-\infty}^{\infty} e^{-x^2/2} = \sqrt{2\pi}\) +-- \[\int_{-\infty}^{\infty} e^{-x^2/2} = \sqrt{2\pi}\] +f = 5 diff --git a/html-test/src/Operators.hs b/html-test/src/Operators.hs index f7b4d0ab..0b633c3f 100644 --- a/html-test/src/Operators.hs +++ b/html-test/src/Operators.hs @@ -1,4 +1,6 @@ {-# LANGUAGE PatternSynonyms, TypeOperators, TypeFamilies, MultiParamTypeClasses, GADTs #-} +{-# LANGUAGE FunctionalDependencies #-} + -- | Test operators with or without fixity declarations module Operators where @@ -42,7 +44,9 @@ data family a ** b infix 9 ** -- | Class with fixity, including associated types -class a ><> b where +class a ><> b | a -> b where + -- Dec 2015: Added @a -> b@ functional dependency to clean up ambiguity + -- See GHC #11264 type a <>< b :: * data a ><< b (>><), (<<>) :: a -> b -> () diff --git a/html-test/src/OrphanInstances.hs b/html-test/src/OrphanInstances.hs new file mode 100644 index 00000000..e50327ee --- /dev/null +++ b/html-test/src/OrphanInstances.hs @@ -0,0 +1,8 @@ +module OrphanInstances where + +import OrphanInstancesType +import OrphanInstancesClass + +-- | This is an orphan instance. +instance AClass AType where + aClass (AType n) = n diff --git a/html-test/src/OrphanInstancesClass.hs b/html-test/src/OrphanInstancesClass.hs new file mode 100644 index 00000000..4b51acfc --- /dev/null +++ b/html-test/src/OrphanInstancesClass.hs @@ -0,0 +1,4 @@ +module OrphanInstancesClass (AClass(..)) where + +class AClass a where + aClass :: a -> Int diff --git a/html-test/src/OrphanInstancesType.hs b/html-test/src/OrphanInstancesType.hs new file mode 100644 index 00000000..b3c3145e --- /dev/null +++ b/html-test/src/OrphanInstancesType.hs @@ -0,0 +1,3 @@ +module OrphanInstancesType (AType(..)) where + +data AType = AType Int |