/usr/share/doc/libghc-tasty-th-doc/html/Test-Tasty-TH.html is in libghc-tasty-th-doc 0.1.3-5build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <!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>Test.Tasty.TH</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_Test-Tasty-TH.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Test-Tasty-TH.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">tasty-th-0.1.3: Automagically generate the HUnit- and Quickcheck-bulk-code using Template Haskell.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Test.Tasty.TH</p></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="#v:testGroupGenerator">testGroupGenerator</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Lib.html#t:ExpQ">ExpQ</a></li><li class="src short"><a href="#v:defaultMainGenerator">defaultMainGenerator</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Lib.html#t:ExpQ">ExpQ</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:testGroupGenerator" class="def">testGroupGenerator</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Lib.html#t:ExpQ">ExpQ</a> <a href="src/Test-Tasty-TH.html#testGroupGenerator" class="link">Source</a></p><div class="doc"><p>Generate the usual code and extract the usual functions needed for a testGroup in HUnit<em>Quickcheck</em>Quickcheck2.
All functions beginning with case_, prop_ or test_ will be extracted.</p><pre>-- file SomeModule.hs
fooTestGroup = $(testGroupGenerator)
main = defaultMain [fooTestGroup]
case_1 = do 1 @=? 1
case_2 = do 2 @=? 2
prop_p xs = reverse (reverse xs) == xs
where types = xs :: [Int]</pre><p>is the same as</p><pre>-- file SomeModule.hs
fooTestGroup = testGroup "SomeModule" [testProperty "p" prop_1, testCase "1" case_1, testCase "2" case_2]
main = defaultMain [fooTestGroup]
case_1 = do 1 @=? 1
case_2 = do 2 @=? 2
prop_1 xs = reverse (reverse xs) == xs
where types = xs :: [Int]</pre></div></div><div class="top"><p class="src"><a name="v:defaultMainGenerator" class="def">defaultMainGenerator</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Lib.html#t:ExpQ">ExpQ</a> <a href="src/Test-Tasty-TH.html#defaultMainGenerator" class="link">Source</a></p><div class="doc"><p>Generate the usual code and extract the usual functions needed in order to run HUnit<em>Quickcheck</em>Quickcheck2.
All functions beginning with case_, prop_ or test_ will be extracted.</p><pre>{-# OPTIONS_GHC -fglasgow-exts -XTemplateHaskell #-}
module MyModuleTest where
import Test.HUnit
import MainTestGenerator
main = $(defaultMainGenerator)
case_Foo = do 4 @=? 4
case_Bar = do "hej" @=? "hej"
prop_Reverse xs = reverse (reverse xs) == xs
where types = xs :: [Int]
test_Group =
[ testCase "1" case_Foo
, testProperty "2" prop_Reverse
]</pre><p>will automagically extract prop_Reverse, case_Foo, case_Bar and test_Group and run them as well as present them as belonging to the testGroup <code>MyModuleTest</code> such as</p><pre>me: runghc MyModuleTest.hs
MyModuleTest:
Reverse: [OK, passed 100 tests]
Foo: [OK]
Bar: [OK]
Group:
1: [OK]
2: [OK, passed 100 tests]
Properties Test Cases Total
Passed 2 3 5
Failed 0 0 0
Total 2 3 5</pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>
|