/usr/share/doc/libghc-chell-doc/html/Test-Chell.html is in libghc-chell-doc 0.4.0.2-1.
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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | <!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.Chell</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Test-Chell.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Test-Chell.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">chell-0.4.0.2: A simple and intuitive library for automated testing.</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.Chell</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Main</a></li><li><a href="#g:2">Test suites</a><ul><li><a href="#g:3">Skipping some tests</a></li></ul></li><li><a href="#g:4">Basic testing library</a><ul><li><a href="#g:5">Built-in assertions</a></li></ul></li><li><a href="#g:6">Custom test types</a><ul><li><a href="#g:7">Test results</a><ul><li><a href="#g:8">Failures</a></li><li><a href="#g:9">Failure locations</a></li></ul></li><li><a href="#g:10">Test options</a></li></ul></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Chell is a simple and intuitive library for automated testing. It natively
supports assertion-based testing, and can use companion libraries
such as <code>chell-quickcheck</code> to support more complex testing strategies.</p><p>An example test suite, which verifies the behavior of artithmetic operators.</p><pre>{-# LANGUAGE TemplateHaskell #-}
import Test.Chell
suite_Math :: Suite
suite_Math = <code><a href="Test-Chell.html#v:suite">suite</a></code> "math"
[ test_Addition
, test_Subtraction
]
test_Addition :: Test
test_Addition = <code><a href="Test-Chell.html#v:assertions">assertions</a></code> "addition" $ do
$<code><a href="Test-Chell.html#v:expect">expect</a></code> (<code><a href="Test-Chell.html#v:equal">equal</a></code> (2 + 1) 3)
$<code><a href="Test-Chell.html#v:expect">expect</a></code> (<code><a href="Test-Chell.html#v:equal">equal</a></code> (1 + 2) 3)
test_Subtraction :: Test
test_Subtraction = <code><a href="Test-Chell.html#v:assertions">assertions</a></code> "subtraction" $ do
$<code><a href="Test-Chell.html#v:expect">expect</a></code> (<code><a href="Test-Chell.html#v:equal">equal</a></code> (2 - 1) 1)
$<code><a href="Test-Chell.html#v:expect">expect</a></code> (<code><a href="Test-Chell.html#v:equal">equal</a></code> (1 - 2) (-1))
main :: IO ()
main = <code><a href="Test-Chell.html#v:defaultMain">defaultMain</a></code> [suite_Math]
</pre><pre>$ ghc --make chell-example.hs
$ ./chell-example
PASS: 2 tests run, 2 tests passed</pre></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="#v:defaultMain">defaultMain</a> :: [<a href="Test-Chell.html#t:Suite">Suite</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><span class="keyword">data</span> <a href="#t:Suite">Suite</a></li><li class="src short"><a href="#v:suite">suite</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> [<a href="Test-Chell.html#t:Test">Test</a>] -> <a href="Test-Chell.html#t:Suite">Suite</a></li><li class="src short"><a href="#v:suiteName">suiteName</a> :: <a href="Test-Chell.html#t:Suite">Suite</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:suiteTests">suiteTests</a> :: <a href="Test-Chell.html#t:Suite">Suite</a> -> [<a href="Test-Chell.html#t:Test">Test</a>]</li><li class="src short"><span class="keyword">class</span> <a href="#t:SuiteOrTest">SuiteOrTest</a> a</li><li class="src short"><a href="#v:skipIf">skipIf</a> :: <a href="Test-Chell.html#t:SuiteOrTest">SuiteOrTest</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> a -> a</li><li class="src short"><a href="#v:skipWhen">skipWhen</a> :: <a href="Test-Chell.html#t:SuiteOrTest">SuiteOrTest</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> a -> a</li><li class="src short"><span class="keyword">data</span> <a href="#t:Assertions">Assertions</a> a</li><li class="src short"><a href="#v:assertions">assertions</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Test-Chell.html#t:Assertions">Assertions</a> a -> <a href="Test-Chell.html#t:Test">Test</a></li><li class="src short"><span class="keyword">class</span> <a href="#t:IsAssertion">IsAssertion</a> a</li><li class="src short"><span class="keyword">data</span> <a href="#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:assertionPassed">assertionPassed</a> :: <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:assertionFailed">assertionFailed</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:assert">assert</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a></li><li class="src short"><a href="#v:expect">expect</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a></li><li class="src short"><a href="#v:die">die</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a></li><li class="src short"><a href="#v:trace">trace</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a></li><li class="src short"><a href="#v:note">note</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Test-Chell.html#t:Assertions">Assertions</a> ()</li><li class="src short"><a href="#v:afterTest">afterTest</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () -> <a href="Test-Chell.html#t:Assertions">Assertions</a> ()</li><li class="src short"><a href="#v:requireLeft">requireLeft</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a></li><li class="src short"><a href="#v:requireRight">requireRight</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a></li><li class="src short"><a href="#v:equal">equal</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:notEqual">notEqual</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:equalWithin">equalWithin</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Real">Real</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) => a -> a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:just">just</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:nothing">nothing</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:left">left</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> b => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Either.html#t:Either">Either</a> a b -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:right">right</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Either.html#t:Either">Either</a> a b -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:throws">throws</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Exception-Base.html#t:Exception">Exception</a> err => (err -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a>) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:throwsEq">throwsEq</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> err, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Exception-Base.html#t:Exception">Exception</a> err, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> err) => err -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:greater">greater</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:greaterEqual">greaterEqual</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:lesser">lesser</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:lesserEqual">lesserEqual</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:sameItems">sameItems</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Foldable.html#t:Foldable">Foldable</a> container, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> item, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> item) => container item -> container item -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:equalItems">equalItems</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Foldable.html#t:Foldable">Foldable</a> container, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> item, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> item) => container item -> container item -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><span class="keyword">class</span> <a href="#t:IsText">IsText</a> a</li><li class="src short"><a href="#v:equalLines">equalLines</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a, <a href="Test-Chell.html#t:IsText">IsText</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:equalLinesWith">equalLinesWith</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a => (a -> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]) -> a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Test">Test</a></li><li class="src short"><a href="#v:test">test</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> (<a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:TestResult">TestResult</a>) -> <a href="Test-Chell.html#t:Test">Test</a></li><li class="src short"><a href="#v:testName">testName</a> :: <a href="Test-Chell.html#t:Test">Test</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:runTest">runTest</a> :: <a href="Test-Chell.html#t:Test">Test</a> -> <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:TestResult">TestResult</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:TestResult">TestResult</a><ul class="subs"><li>= <a href="#v:TestPassed">TestPassed</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)]</li><li>| <a href="#v:TestSkipped">TestSkipped</a></li><li>| <a href="#v:TestFailed">TestFailed</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)] [<a href="Test-Chell.html#t:Failure">Failure</a>]</li><li>| <a href="#v:TestAborted">TestAborted</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)] <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Failure">Failure</a></li><li class="src short"><a href="#v:failure">failure</a> :: <a href="Test-Chell.html#t:Failure">Failure</a></li><li class="src short"><a href="#v:failureLocation">failureLocation</a> :: <a href="Test-Chell.html#t:Failure">Failure</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Test-Chell.html#t:Location">Location</a></li><li class="src short"><a href="#v:failureMessage">failureMessage</a> :: <a href="Test-Chell.html#t:Failure">Failure</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Location">Location</a></li><li class="src short"><a href="#v:location">location</a> :: <a href="Test-Chell.html#t:Location">Location</a></li><li class="src short"><a href="#v:locationFile">locationFile</a> :: <a href="Test-Chell.html#t:Location">Location</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:locationModule">locationModule</a> :: <a href="Test-Chell.html#t:Location">Location</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:locationLine">locationLine</a> :: <a href="Test-Chell.html#t:Location">Location</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:TestOptions">TestOptions</a></li><li class="src short"><a href="#v:defaultTestOptions">defaultTestOptions</a> :: <a href="Test-Chell.html#t:TestOptions">TestOptions</a></li><li class="src short"><a href="#v:testOptionSeed">testOptionSeed</a> :: <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:testOptionTimeout">testOptionTimeout</a> :: <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li></ul></div><div id="interface"><h1 id="g:1">Main</h1><div class="top"><p class="src"><a id="v:defaultMain" class="def">defaultMain</a> :: [<a href="Test-Chell.html#t:Suite">Suite</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Test-Chell-Main.html#defaultMain" class="link">Source</a> <a href="#v:defaultMain" class="selflink">#</a></p><div class="doc"><p>A simple default main function, which runs a list of tests and logs
statistics to stdout.</p></div></div><h1 id="g:2">Test suites</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Suite" class="def">Suite</a> <a href="src/Test-Chell-Types.html#Suite" class="link">Source</a> <a href="#t:Suite" class="selflink">#</a></p><div class="doc"><p>A suite is a named collection of tests.</p><p>Note: earlier versions of Chell permitted arbitrary nesting of test suites.
This feature proved too unwieldy, and was removed. A similar result can be
achieved with <code><a href="Test-Chell.html#v:suiteTests">suiteTests</a></code>; see the documentation for <code><a href="Test-Chell.html#v:suite">suite</a></code>.</p></div><div class="subs instances"><p id="control.i:Suite" class="caption collapser" onclick="toggleSection('i:Suite')">Instances</p><div id="section.i:Suite" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Suite:Show:1" class="instance expander" onclick="toggleSection('i:id:Suite:Show:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Test-Chell.html#t:Suite">Suite</a></span> <a href="src/Test-Chell-Types.html#line-181" class="link">Source</a> <a href="#t:Suite" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Suite:Show:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Test-Chell.html#t:Suite">Suite</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Test-Chell.html#t:Suite">Suite</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Test-Chell.html#t:Suite">Suite</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Suite:SuiteOrTest:2" class="instance expander" onclick="toggleSection('i:id:Suite:SuiteOrTest:2')"></span> <a href="Test-Chell.html#t:SuiteOrTest">SuiteOrTest</a> <a href="Test-Chell.html#t:Suite">Suite</a></span> <a href="src/Test-Chell-Types.html#line-187" class="link">Source</a> <a href="#t:Suite" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Suite:SuiteOrTest:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:skipIf_">skipIf_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Test-Chell.html#t:Suite">Suite</a> -> <a href="Test-Chell.html#t:Suite">Suite</a></p><p class="src"><a href="#v:skipWhen_">skipWhen_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Test-Chell.html#t:Suite">Suite</a> -> <a href="Test-Chell.html#t:Suite">Suite</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:suite" class="def">suite</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> [<a href="Test-Chell.html#t:Test">Test</a>] -> <a href="Test-Chell.html#t:Suite">Suite</a> <a href="src/Test-Chell-Types.html#suite" class="link">Source</a> <a href="#v:suite" class="selflink">#</a></p><div class="doc"><p>Define a new <code><a href="Test-Chell.html#t:Suite">Suite</a></code>, with the given name and children.</p><p>Note: earlier versions of Chell permitted arbitrary nesting of test suites.
This feature proved too unwieldy, and was removed. A similar result can be
achieved with <code><a href="Test-Chell.html#v:suiteTests">suiteTests</a></code>:</p><pre>test_Addition :: Test
test_Subtraction :: Test
test_Show :: Test
suite_Math :: Suite
suite_Math = <code><a href="Test-Chell.html#v:suite">suite</a></code> "math"
[ test_Addition
, test_Subtraction
]
suite_Prelude :: Suite
suite_Prelude = <code><a href="Test-Chell.html#v:suite">suite</a></code> "prelude"
(
[ test_Show
]
++ suiteTests suite_Math
)
</pre></div></div><div class="top"><p class="src"><a id="v:suiteName" class="def">suiteName</a> :: <a href="Test-Chell.html#t:Suite">Suite</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="src/Test-Chell-Types.html#suiteName" class="link">Source</a> <a href="#v:suiteName" class="selflink">#</a></p><div class="doc"><p>Get a suite's name. Suite names may be any string, but are typically
plain ASCII so users can easily type them on the command line.</p><pre>$ ghci chell-example.hs
Ok, modules loaded: Main.
*Main> suiteName tests_Math
"math"</pre></div></div><div class="top"><p class="src"><a id="v:suiteTests" class="def">suiteTests</a> :: <a href="Test-Chell.html#t:Suite">Suite</a> -> [<a href="Test-Chell.html#t:Test">Test</a>] <a href="src/Test-Chell-Types.html#suiteTests" class="link">Source</a> <a href="#v:suiteTests" class="selflink">#</a></p><div class="doc"><p>Get the full list of tests contained within this <code><a href="Test-Chell.html#t:Suite">Suite</a></code>. Each test is
given its full name within the test hierarchy, where names are separated
by periods.</p><pre>$ ghci chell-example.hs
Ok, modules loaded: Main.
*Main> suiteTests tests_Math
[Test "math.addition",Test "math.subtraction"]</pre></div></div><h2 id="g:3">Skipping some tests</h2><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:SuiteOrTest" class="def">SuiteOrTest</a> a <a href="src/Test-Chell-Types.html#SuiteOrTest" class="link">Source</a> <a href="#t:SuiteOrTest" class="selflink">#</a></p><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src">skipIf_, skipWhen_</p></div><div class="subs instances"><p id="control.i:SuiteOrTest" class="caption collapser" onclick="toggleSection('i:SuiteOrTest')">Instances</p><div id="section.i:SuiteOrTest" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:SuiteOrTest:SuiteOrTest:1" class="instance expander" onclick="toggleSection('i:ic:SuiteOrTest:SuiteOrTest:1')"></span> <a href="Test-Chell.html#t:SuiteOrTest">SuiteOrTest</a> <a href="Test-Chell.html#t:Suite">Suite</a></span> <a href="src/Test-Chell-Types.html#line-187" class="link">Source</a> <a href="#t:SuiteOrTest" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:SuiteOrTest:SuiteOrTest:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:skipIf_">skipIf_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Test-Chell.html#t:Suite">Suite</a> -> <a href="Test-Chell.html#t:Suite">Suite</a></p><p class="src"><a href="#v:skipWhen_">skipWhen_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Test-Chell.html#t:Suite">Suite</a> -> <a href="Test-Chell.html#t:Suite">Suite</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:SuiteOrTest:SuiteOrTest:2" class="instance expander" onclick="toggleSection('i:ic:SuiteOrTest:SuiteOrTest:2')"></span> <a href="Test-Chell.html#t:SuiteOrTest">SuiteOrTest</a> <a href="Test-Chell.html#t:Test">Test</a></span> <a href="src/Test-Chell-Types.html#line-193" class="link">Source</a> <a href="#t:SuiteOrTest" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:SuiteOrTest:SuiteOrTest:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:skipIf_">skipIf_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Test-Chell.html#t:Test">Test</a> -> <a href="Test-Chell.html#t:Test">Test</a></p><p class="src"><a href="#v:skipWhen_">skipWhen_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Test-Chell.html#t:Test">Test</a> -> <a href="Test-Chell.html#t:Test">Test</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:skipIf" class="def">skipIf</a> :: <a href="Test-Chell.html#t:SuiteOrTest">SuiteOrTest</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> a -> a <a href="src/Test-Chell-Types.html#skipIf" class="link">Source</a> <a href="#v:skipIf" class="selflink">#</a></p><div class="doc"><p>Conditionally skip tests. Use this to avoid commenting out tests
which are currently broken, or do not work on the current platform.</p><pre>tests :: Suite
tests = <code><a href="Test-Chell.html#v:suite">suite</a></code> "tests"
[ test_Foo
, <code><a href="Test-Chell.html#v:skipIf">skipIf</a></code> builtOnUnix test_WindowsSpecific
, test_Bar
]
</pre></div></div><div class="top"><p class="src"><a id="v:skipWhen" class="def">skipWhen</a> :: <a href="Test-Chell.html#t:SuiteOrTest">SuiteOrTest</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> a -> a <a href="src/Test-Chell-Types.html#skipWhen" class="link">Source</a> <a href="#v:skipWhen" class="selflink">#</a></p><div class="doc"><p>Conditionally skip tests, depending on the result of a runtime check. The
predicate is checked before each test is started.</p><pre>tests :: Suite
tests = <code><a href="Test-Chell.html#v:suite">suite</a></code> "tests"
[ test_Foo
, <code><a href="Test-Chell.html#v:skipWhen">skipWhen</a></code> noNetwork test_PingGoogle
, test_Bar
]
</pre></div></div><h1 id="g:4">Basic testing library</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Assertions" class="def">Assertions</a> a <a href="src/Test-Chell.html#Assertions" class="link">Source</a> <a href="#t:Assertions" class="selflink">#</a></p><div class="doc"><p>See <code><a href="Test-Chell.html#v:assertions">assertions</a></code>.</p></div><div class="subs instances"><p id="control.i:Assertions" class="caption collapser" onclick="toggleSection('i:Assertions')">Instances</p><div id="section.i:Assertions" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Assertions:Monad:1" class="instance expander" onclick="toggleSection('i:id:Assertions:Monad:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#t:Monad">Monad</a> <a href="Test-Chell.html#t:Assertions">Assertions</a></span> <a href="src/Test-Chell.html#line-184" class="link">Source</a> <a href="#t:Assertions" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Assertions:Monad:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-62--62--61-">(>>=)</a> :: <a href="Test-Chell.html#t:Assertions">Assertions</a> a -> (a -> <a href="Test-Chell.html#t:Assertions">Assertions</a> b) -> <a href="Test-Chell.html#t:Assertions">Assertions</a> b <a href="#v:-62--62--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62--62-">(>>)</a> :: <a href="Test-Chell.html#t:Assertions">Assertions</a> a -> <a href="Test-Chell.html#t:Assertions">Assertions</a> b -> <a href="Test-Chell.html#t:Assertions">Assertions</a> b <a href="#v:-62--62-" class="selflink">#</a></p><p class="src"><a href="#v:return">return</a> :: a -> <a href="Test-Chell.html#t:Assertions">Assertions</a> a <a href="#v:return" class="selflink">#</a></p><p class="src"><a href="#v:fail">fail</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Test-Chell.html#t:Assertions">Assertions</a> a <a href="#v:fail" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Assertions:Functor:2" class="instance expander" onclick="toggleSection('i:id:Assertions:Functor:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Functor.html#t:Functor">Functor</a> <a href="Test-Chell.html#t:Assertions">Assertions</a></span> <a href="src/Test-Chell.html#line-177" class="link">Source</a> <a href="#t:Assertions" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Assertions:Functor:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fmap">fmap</a> :: (a -> b) -> <a href="Test-Chell.html#t:Assertions">Assertions</a> a -> <a href="Test-Chell.html#t:Assertions">Assertions</a> b <a href="#v:fmap" class="selflink">#</a></p><p class="src"><a href="#v:-60--36-">(<$)</a> :: a -> <a href="Test-Chell.html#t:Assertions">Assertions</a> b -> <a href="Test-Chell.html#t:Assertions">Assertions</a> a <a href="#v:-60--36-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Assertions:Applicative:3" class="instance expander" onclick="toggleSection('i:id:Assertions:Applicative:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a> <a href="Test-Chell.html#t:Assertions">Assertions</a></span> <a href="src/Test-Chell.html#line-180" class="link">Source</a> <a href="#t:Assertions" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Assertions:Applicative:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pure">pure</a> :: a -> <a href="Test-Chell.html#t:Assertions">Assertions</a> a <a href="#v:pure" class="selflink">#</a></p><p class="src"><a href="#v:-60--42--62-">(<*>)</a> :: <a href="Test-Chell.html#t:Assertions">Assertions</a> (a -> b) -> <a href="Test-Chell.html#t:Assertions">Assertions</a> a -> <a href="Test-Chell.html#t:Assertions">Assertions</a> b <a href="#v:-60--42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-42--62-">(*>)</a> :: <a href="Test-Chell.html#t:Assertions">Assertions</a> a -> <a href="Test-Chell.html#t:Assertions">Assertions</a> b -> <a href="Test-Chell.html#t:Assertions">Assertions</a> b <a href="#v:-42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-60--42-">(<*)</a> :: <a href="Test-Chell.html#t:Assertions">Assertions</a> a -> <a href="Test-Chell.html#t:Assertions">Assertions</a> b -> <a href="Test-Chell.html#t:Assertions">Assertions</a> a <a href="#v:-60--42-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Assertions:MonadIO:4" class="instance expander" onclick="toggleSection('i:id:Assertions:MonadIO:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> <a href="Test-Chell.html#t:Assertions">Assertions</a></span> <a href="src/Test-Chell.html#line-192" class="link">Source</a> <a href="#t:Assertions" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Assertions:MonadIO:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftIO">liftIO</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a -> <a href="Test-Chell.html#t:Assertions">Assertions</a> a <a href="#v:liftIO" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:assertions" class="def">assertions</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Test-Chell.html#t:Assertions">Assertions</a> a -> <a href="Test-Chell.html#t:Test">Test</a> <a href="src/Test-Chell.html#assertions" class="link">Source</a> <a href="#v:assertions" class="selflink">#</a></p><div class="doc"><p>Convert a sequence of pass/fail assertions into a runnable test.</p><pre>test_Equality :: Test
test_Equality = assertions "equality" $ do
$assert (1 == 1)
$assert (equal 1 1)
</pre></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:IsAssertion" class="def">IsAssertion</a> a <a href="src/Test-Chell.html#IsAssertion" class="link">Source</a> <a href="#t:IsAssertion" class="selflink">#</a></p><div class="doc"><p>See <code><a href="Test-Chell.html#v:assert">assert</a></code> and <code><a href="Test-Chell.html#v:expect">expect</a></code>.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src">runAssertion</p></div><div class="subs instances"><p id="control.i:IsAssertion" class="caption collapser" onclick="toggleSection('i:IsAssertion')">Instances</p><div id="section.i:IsAssertion" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:IsAssertion:IsAssertion:1" class="instance expander" onclick="toggleSection('i:ic:IsAssertion:IsAssertion:1')"></span> <a href="Test-Chell.html#t:IsAssertion">IsAssertion</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></span> <a href="src/Test-Chell.html#line-164" class="link">Source</a> <a href="#t:IsAssertion" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:IsAssertion:IsAssertion:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:runAssertion">runAssertion</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:Assertion">Assertion</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:IsAssertion:IsAssertion:2" class="instance expander" onclick="toggleSection('i:ic:IsAssertion:IsAssertion:2')"></span> <a href="Test-Chell.html#t:IsAssertion">IsAssertion</a> <a href="Test-Chell.html#t:Assertion">Assertion</a></span> <a href="src/Test-Chell.html#line-161" class="link">Source</a> <a href="#t:IsAssertion" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:IsAssertion:IsAssertion:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:runAssertion">runAssertion</a> :: <a href="Test-Chell.html#t:Assertion">Assertion</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:Assertion">Assertion</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:IsAssertion:IsAssertion:3" class="instance expander" onclick="toggleSection('i:ic:IsAssertion:IsAssertion:3')"></span> <a href="Test-Chell.html#t:IsAssertion">IsAssertion</a> a => <a href="Test-Chell.html#t:IsAssertion">IsAssertion</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a)</span> <a href="src/Test-Chell.html#line-169" class="link">Source</a> <a href="#t:IsAssertion" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:IsAssertion:IsAssertion:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:runAssertion">runAssertion</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:Assertion">Assertion</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Assertion" class="def">Assertion</a> <a href="src/Test-Chell.html#Assertion" class="link">Source</a> <a href="#t:Assertion" class="selflink">#</a></p><div class="doc"><p>A single pass/fail assertion. Failed assertions include an explanatory
message.</p></div><div class="subs instances"><p id="control.i:Assertion" class="caption collapser" onclick="toggleSection('i:Assertion')">Instances</p><div id="section.i:Assertion" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Assertion:Eq:1" class="instance expander" onclick="toggleSection('i:id:Assertion:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Test-Chell.html#t:Assertion">Assertion</a></span> <a href="src/Test-Chell.html#line-147" class="link">Source</a> <a href="#t:Assertion" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Assertion:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Test-Chell.html#t:Assertion">Assertion</a> -> <a href="Test-Chell.html#t:Assertion">Assertion</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Test-Chell.html#t:Assertion">Assertion</a> -> <a href="Test-Chell.html#t:Assertion">Assertion</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Assertion:Show:2" class="instance expander" onclick="toggleSection('i:id:Assertion:Show:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Test-Chell.html#t:Assertion">Assertion</a></span> <a href="src/Test-Chell.html#line-147" class="link">Source</a> <a href="#t:Assertion" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Assertion:Show:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Test-Chell.html#t:Assertion">Assertion</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Test-Chell.html#t:Assertion">Assertion</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Test-Chell.html#t:Assertion">Assertion</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Assertion:IsAssertion:3" class="instance expander" onclick="toggleSection('i:id:Assertion:IsAssertion:3')"></span> <a href="Test-Chell.html#t:IsAssertion">IsAssertion</a> <a href="Test-Chell.html#t:Assertion">Assertion</a></span> <a href="src/Test-Chell.html#line-161" class="link">Source</a> <a href="#t:Assertion" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Assertion:IsAssertion:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:runAssertion">runAssertion</a> :: <a href="Test-Chell.html#t:Assertion">Assertion</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:Assertion">Assertion</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:assertionPassed" class="def">assertionPassed</a> :: <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#assertionPassed" class="link">Source</a> <a href="#v:assertionPassed" class="selflink">#</a></p><div class="doc"><p>See <code><a href="Test-Chell.html#t:Assertion">Assertion</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:assertionFailed" class="def">assertionFailed</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#assertionFailed" class="link">Source</a> <a href="#v:assertionFailed" class="selflink">#</a></p><div class="doc"><p>See <code><a href="Test-Chell.html#t:Assertion">Assertion</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:assert" class="def">assert</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a> <a href="src/Test-Chell.html#assert" class="link">Source</a> <a href="#v:assert" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:expect" class="def">expect</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a> <a href="src/Test-Chell.html#expect" class="link">Source</a> <a href="#v:expect" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:die" class="def">die</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a> <a href="src/Test-Chell.html#die" class="link">Source</a> <a href="#v:die" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:trace" class="def">trace</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a> <a href="src/Test-Chell.html#trace" class="link">Source</a> <a href="#v:trace" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:note" class="def">note</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Test-Chell.html#t:Assertions">Assertions</a> () <a href="src/Test-Chell.html#note" class="link">Source</a> <a href="#v:note" class="selflink">#</a></p><div class="doc"><p>Attach a note to a test run. Notes will be printed to stdout and
included in reports, even if the test fails or aborts. Notes are useful for
debugging failing tests.</p></div></div><div class="top"><p class="src"><a id="v:afterTest" class="def">afterTest</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () -> <a href="Test-Chell.html#t:Assertions">Assertions</a> () <a href="src/Test-Chell.html#afterTest" class="link">Source</a> <a href="#v:afterTest" class="selflink">#</a></p><div class="doc"><p>Register an IO action to be run after the test completes. This action
will run even if the test failed or aborted.</p></div></div><div class="top"><p class="src"><a id="v:requireLeft" class="def">requireLeft</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a> <a href="src/Test-Chell.html#requireLeft" class="link">Source</a> <a href="#v:requireLeft" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:requireRight" class="def">requireRight</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.11.1.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a> <a href="src/Test-Chell.html#requireRight" class="link">Source</a> <a href="#v:requireRight" class="selflink">#</a></p></div><h2 id="g:5">Built-in assertions</h2><div class="top"><p class="src"><a id="v:equal" class="def">equal</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#equal" class="link">Source</a> <a href="#v:equal" class="selflink">#</a></p><div class="doc"><p>Assert that two values are equal.</p></div></div><div class="top"><p class="src"><a id="v:notEqual" class="def">notEqual</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#notEqual" class="link">Source</a> <a href="#v:notEqual" class="selflink">#</a></p><div class="doc"><p>Assert that two values are not equal.</p></div></div><div class="top"><p class="src"><a id="v:equalWithin" class="def">equalWithin</a> <a href="src/Test-Chell.html#equalWithin" class="link">Source</a> <a href="#v:equalWithin" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Real">Real</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src">=> a</td><td class="doc empty"> </td></tr><tr><td class="src">-> a</td><td class="doc empty"> </td></tr><tr><td class="src">-> a</td><td class="doc"><p>delta</p></td></tr><tr><td class="src">-> <a href="Test-Chell.html#t:Assertion">Assertion</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Assert that two values are within some delta of each other.</p></div></div><div class="top"><p class="src"><a id="v:just" class="def">just</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#just" class="link">Source</a> <a href="#v:just" class="selflink">#</a></p><div class="doc"><p>Assert that some value is <code>Just</code>.</p></div></div><div class="top"><p class="src"><a id="v:nothing" class="def">nothing</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#nothing" class="link">Source</a> <a href="#v:nothing" class="selflink">#</a></p><div class="doc"><p>Assert that some value is <code>Nothing</code>.</p></div></div><div class="top"><p class="src"><a id="v:left" class="def">left</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> b => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Either.html#t:Either">Either</a> a b -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#left" class="link">Source</a> <a href="#v:left" class="selflink">#</a></p><div class="doc"><p>Assert that some value is <code>Left</code>.</p></div></div><div class="top"><p class="src"><a id="v:right" class="def">right</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Either.html#t:Either">Either</a> a b -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#right" class="link">Source</a> <a href="#v:right" class="selflink">#</a></p><div class="doc"><p>Assert that some value is <code>Right</code>.</p></div></div><div class="top"><p class="src"><a id="v:throws" class="def">throws</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Exception-Base.html#t:Exception">Exception</a> err => (err -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a>) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#throws" class="link">Source</a> <a href="#v:throws" class="selflink">#</a></p><div class="doc"><p>Assert that some computation throws an exception matching the provided
predicate. This is mostly useful for exception types which do not have an
instance for <code>Eq</code>, such as <code><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Exception-Base.html#t:ErrorCall">ErrorCall</a></code></code>.</p></div></div><div class="top"><p class="src"><a id="v:throwsEq" class="def">throwsEq</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> err, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Exception-Base.html#t:Exception">Exception</a> err, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> err) => err -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#throwsEq" class="link">Source</a> <a href="#v:throwsEq" class="selflink">#</a></p><div class="doc"><p>Assert that some computation throws an exception equal to the given
exception. This is better than just checking that the correct type was
thrown, because the test can also verify the exception contains the correct
information.</p></div></div><div class="top"><p class="src"><a id="v:greater" class="def">greater</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#greater" class="link">Source</a> <a href="#v:greater" class="selflink">#</a></p><div class="doc"><p>Assert a value is greater than another.</p></div></div><div class="top"><p class="src"><a id="v:greaterEqual" class="def">greaterEqual</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#greaterEqual" class="link">Source</a> <a href="#v:greaterEqual" class="selflink">#</a></p><div class="doc"><p>Assert a value is greater than or equal to another.</p></div></div><div class="top"><p class="src"><a id="v:lesser" class="def">lesser</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#lesser" class="link">Source</a> <a href="#v:lesser" class="selflink">#</a></p><div class="doc"><p>Assert a value is less than another.</p></div></div><div class="top"><p class="src"><a id="v:lesserEqual" class="def">lesserEqual</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#lesserEqual" class="link">Source</a> <a href="#v:lesserEqual" class="selflink">#</a></p><div class="doc"><p>Assert a value is less than or equal to another.</p></div></div><div class="top"><p class="src"><a id="v:sameItems" class="def">sameItems</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Foldable.html#t:Foldable">Foldable</a> container, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> item, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> item) => container item -> container item -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#sameItems" class="link">Source</a> <a href="#v:sameItems" class="selflink">#</a></p><div class="doc"><p>Assert that two containers have the same items, in any order.</p></div></div><div class="top"><p class="src"><a id="v:equalItems" class="def">equalItems</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Foldable.html#t:Foldable">Foldable</a> container, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> item, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> item) => container item -> container item -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#equalItems" class="link">Source</a> <a href="#v:equalItems" class="selflink">#</a></p><div class="doc"><p>Assert that two containers have the same items, in the same order.</p></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:IsText" class="def">IsText</a> a <a href="src/Test-Chell.html#IsText" class="link">Source</a> <a href="#t:IsText" class="selflink">#</a></p><div class="doc"><p>Class for types which can be treated as text; see <code><a href="Test-Chell.html#v:equalLines">equalLines</a></code>.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src">toLines, unpack</p></div><div class="subs instances"><p id="control.i:IsText" class="caption collapser" onclick="toggleSection('i:IsText')">Instances</p><div id="section.i:IsText" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:IsText:IsText:1" class="instance expander" onclick="toggleSection('i:ic:IsText:IsText:1')"></span> <a href="Test-Chell.html#t:IsText">IsText</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></span> <a href="src/Test-Chell.html#line-516" class="link">Source</a> <a href="#t:IsText" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:IsText:IsText:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toLines">toLines</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:IsText:IsText:2" class="instance expander" onclick="toggleSection('i:ic:IsText:IsText:2')"></span> <a href="Test-Chell.html#t:IsText">IsText</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></span> <a href="src/Test-Chell.html#line-534" class="link">Source</a> <a href="#t:IsText" class="selflink">#</a></td><td class="doc"><p>Uses <code>Data.ByteString.Lazy.Char8</code></p></td></tr><tr><td colspan="2"><div id="section.i:ic:IsText:IsText:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toLines">toLines</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>]</p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:IsText:IsText:3" class="instance expander" onclick="toggleSection('i:ic:IsText:IsText:3')"></span> <a href="Test-Chell.html#t:IsText">IsText</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></span> <a href="src/Test-Chell.html#line-529" class="link">Source</a> <a href="#t:IsText" class="selflink">#</a></td><td class="doc"><p>Uses <code>Data.ByteString.Char8</code></p></td></tr><tr><td colspan="2"><div id="section.i:ic:IsText:IsText:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toLines">toLines</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>]</p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:IsText:IsText:4" class="instance expander" onclick="toggleSection('i:ic:IsText:IsText:4')"></span> <a href="Test-Chell.html#t:IsText">IsText</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a></span> <a href="src/Test-Chell.html#line-524" class="link">Source</a> <a href="#t:IsText" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:IsText:IsText:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toLines">toLines</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> -> [<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a>]</p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:IsText:IsText:5" class="instance expander" onclick="toggleSection('i:ic:IsText:IsText:5')"></span> <a href="Test-Chell.html#t:IsText">IsText</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></span> <a href="src/Test-Chell.html#line-520" class="link">Source</a> <a href="#t:IsText" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:IsText:IsText:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toLines">toLines</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -> [<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a>]</p><p class="src"><a href="#v:unpack">unpack</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:equalLines" class="def">equalLines</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a, <a href="Test-Chell.html#t:IsText">IsText</a> a) => a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#equalLines" class="link">Source</a> <a href="#v:equalLines" class="selflink">#</a></p><div class="doc"><p>Assert that two pieces of text are equal. This uses a diff algorithm
to check line-by-line, so the error message will be easier to read on
large inputs.</p></div></div><div class="top"><p class="src"><a id="v:equalLinesWith" class="def">equalLinesWith</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a => (a -> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]) -> a -> a -> <a href="Test-Chell.html#t:Assertion">Assertion</a> <a href="src/Test-Chell.html#equalLinesWith" class="link">Source</a> <a href="#v:equalLinesWith" class="selflink">#</a></p><div class="doc"><p>Variant of <code><a href="Test-Chell.html#v:equalLines">equalLines</a></code> which allows a user-specified line-splitting
predicate.</p></div></div><h1 id="g:6">Custom test types</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Test" class="def">Test</a> <a href="src/Test-Chell-Types.html#Test" class="link">Source</a> <a href="#t:Test" class="selflink">#</a></p><div class="doc"><p>A <code><a href="Test-Chell.html#t:Test">Test</a></code> is, essentially, an IO action that returns a <code><a href="Test-Chell.html#t:TestResult">TestResult</a></code>. Tests
are aggregated into suites (see <code><a href="Test-Chell.html#t:Suite">Suite</a></code>).</p></div><div class="subs instances"><p id="control.i:Test" class="caption collapser" onclick="toggleSection('i:Test')">Instances</p><div id="section.i:Test" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Test:Show:1" class="instance expander" onclick="toggleSection('i:id:Test:Show:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Test-Chell.html#t:Test">Test</a></span> <a href="src/Test-Chell-Types.html#line-46" class="link">Source</a> <a href="#t:Test" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Test:Show:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Test-Chell.html#t:Test">Test</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Test-Chell.html#t:Test">Test</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Test-Chell.html#t:Test">Test</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Test:SuiteOrTest:2" class="instance expander" onclick="toggleSection('i:id:Test:SuiteOrTest:2')"></span> <a href="Test-Chell.html#t:SuiteOrTest">SuiteOrTest</a> <a href="Test-Chell.html#t:Test">Test</a></span> <a href="src/Test-Chell-Types.html#line-193" class="link">Source</a> <a href="#t:Test" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Test:SuiteOrTest:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:skipIf_">skipIf_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Test-Chell.html#t:Test">Test</a> -> <a href="Test-Chell.html#t:Test">Test</a></p><p class="src"><a href="#v:skipWhen_">skipWhen_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="Test-Chell.html#t:Test">Test</a> -> <a href="Test-Chell.html#t:Test">Test</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:test" class="def">test</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> (<a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:TestResult">TestResult</a>) -> <a href="Test-Chell.html#t:Test">Test</a> <a href="src/Test-Chell-Types.html#test" class="link">Source</a> <a href="#v:test" class="selflink">#</a></p><div class="doc"><p>Define a test, with the given name and implementation.</p></div></div><div class="top"><p class="src"><a id="v:testName" class="def">testName</a> :: <a href="Test-Chell.html#t:Test">Test</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="src/Test-Chell-Types.html#testName" class="link">Source</a> <a href="#v:testName" class="selflink">#</a></p><div class="doc"><p>Get the name a test was given when it was defined; see <code><a href="Test-Chell.html#v:test">test</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:runTest" class="def">runTest</a> :: <a href="Test-Chell.html#t:Test">Test</a> -> <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Test-Chell.html#t:TestResult">TestResult</a> <a href="src/Test-Chell-Types.html#runTest" class="link">Source</a> <a href="#v:runTest" class="selflink">#</a></p><div class="doc"><p>Run a test, wrapped in error handlers. This will return <code><a href="Test-Chell.html#v:TestAborted">TestAborted</a></code> if
the test throws an exception or times out.</p></div></div><h2 id="g:7">Test results</h2><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:TestResult" class="def">TestResult</a> <a href="src/Test-Chell-Types.html#TestResult" class="link">Source</a> <a href="#t:TestResult" class="selflink">#</a></p><div class="doc"><p>The result of running a test.</p><p>To support future extensions to the testing API, any users of this module
who pattern-match against the <code><a href="Test-Chell.html#t:TestResult">TestResult</a></code> constructors should include a
default case. If no default case is provided, a warning will be issued.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:TestPassed" class="def">TestPassed</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)]</td><td class="doc"><p>The test passed, and generated the given notes.</p></td></tr><tr><td class="src"><a id="v:TestSkipped" class="def">TestSkipped</a></td><td class="doc"><p>The test did not run, because it was skipped with <code><a href="Test-Chell.html#v:skipIf">skipIf</a></code>
or <code><a href="Test-Chell.html#v:skipWhen">skipWhen</a></code>.</p></td></tr><tr><td class="src"><a id="v:TestFailed" class="def">TestFailed</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)] [<a href="Test-Chell.html#t:Failure">Failure</a>]</td><td class="doc"><p>The test failed, generating the given notes and failures.</p></td></tr><tr><td class="src"><a id="v:TestAborted" class="def">TestAborted</a> [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)] <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>The test aborted with an error message, and generated the given
notes.</p></td></tr></table></div><div class="subs instances"><p id="control.i:TestResult" class="caption collapser" onclick="toggleSection('i:TestResult')">Instances</p><div id="section.i:TestResult" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:TestResult:Eq:1" class="instance expander" onclick="toggleSection('i:id:TestResult:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Test-Chell.html#t:TestResult">TestResult</a></span> <a href="src/Test-Chell-Types.html#line-124" class="link">Source</a> <a href="#t:TestResult" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:TestResult:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Test-Chell.html#t:TestResult">TestResult</a> -> <a href="Test-Chell.html#t:TestResult">TestResult</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Test-Chell.html#t:TestResult">TestResult</a> -> <a href="Test-Chell.html#t:TestResult">TestResult</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:TestResult:Show:2" class="instance expander" onclick="toggleSection('i:id:TestResult:Show:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Test-Chell.html#t:TestResult">TestResult</a></span> <a href="src/Test-Chell-Types.html#line-124" class="link">Source</a> <a href="#t:TestResult" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:TestResult:Show:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Test-Chell.html#t:TestResult">TestResult</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Test-Chell.html#t:TestResult">TestResult</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Test-Chell.html#t:TestResult">TestResult</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><h3 id="g:8">Failures</h3><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Failure" class="def">Failure</a> <a href="src/Test-Chell-Types.html#Failure" class="link">Source</a> <a href="#t:Failure" class="selflink">#</a></p><div class="doc"><p>Contains details about a test failure.</p></div><div class="subs instances"><p id="control.i:Failure" class="caption collapser" onclick="toggleSection('i:Failure')">Instances</p><div id="section.i:Failure" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Failure:Eq:1" class="instance expander" onclick="toggleSection('i:id:Failure:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Test-Chell.html#t:Failure">Failure</a></span> <a href="src/Test-Chell-Types.html#line-142" class="link">Source</a> <a href="#t:Failure" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Failure:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Test-Chell.html#t:Failure">Failure</a> -> <a href="Test-Chell.html#t:Failure">Failure</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Test-Chell.html#t:Failure">Failure</a> -> <a href="Test-Chell.html#t:Failure">Failure</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Failure:Show:2" class="instance expander" onclick="toggleSection('i:id:Failure:Show:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Test-Chell.html#t:Failure">Failure</a></span> <a href="src/Test-Chell-Types.html#line-142" class="link">Source</a> <a href="#t:Failure" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Failure:Show:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Test-Chell.html#t:Failure">Failure</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Test-Chell.html#t:Failure">Failure</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Test-Chell.html#t:Failure">Failure</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:failure" class="def">failure</a> :: <a href="Test-Chell.html#t:Failure">Failure</a> <a href="src/Test-Chell-Types.html#failure" class="link">Source</a> <a href="#v:failure" class="selflink">#</a></p><div class="doc"><p>An empty <code><a href="Test-Chell.html#t:Failure">Failure</a></code>; use the field accessors to populate this value.</p></div></div><div class="top"><p class="src"><a id="v:failureLocation" class="def">failureLocation</a> :: <a href="Test-Chell.html#t:Failure">Failure</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Test-Chell.html#t:Location">Location</a> <a href="src/Test-Chell-Types.html#failureLocation" class="link">Source</a> <a href="#v:failureLocation" class="selflink">#</a></p><div class="doc"><p>If given, the location of the failing assertion, expectation,
etc.</p><p><code><a href="Test-Chell.html#v:failureLocation">failureLocation</a></code> is a field accessor, and can be used to update
a <code><a href="Test-Chell.html#t:Failure">Failure</a></code> value.</p></div></div><div class="top"><p class="src"><a id="v:failureMessage" class="def">failureMessage</a> :: <a href="Test-Chell.html#t:Failure">Failure</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="src/Test-Chell-Types.html#failureMessage" class="link">Source</a> <a href="#v:failureMessage" class="selflink">#</a></p><div class="doc"><p>If given, a message which explains why the test failed.</p><p><code><a href="Test-Chell.html#v:failureMessage">failureMessage</a></code> is a field accessor, and can be used to update
a <code><a href="Test-Chell.html#t:Failure">Failure</a></code> value.</p></div></div><h3 id="g:9">Failure locations</h3><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Location" class="def">Location</a> <a href="src/Test-Chell-Types.html#Location" class="link">Source</a> <a href="#t:Location" class="selflink">#</a></p><div class="doc"><p>Contains details about a location in the test source file.</p></div><div class="subs instances"><p id="control.i:Location" class="caption collapser" onclick="toggleSection('i:Location')">Instances</p><div id="section.i:Location" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Location:Eq:1" class="instance expander" onclick="toggleSection('i:id:Location:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Test-Chell.html#t:Location">Location</a></span> <a href="src/Test-Chell-Types.html#line-169" class="link">Source</a> <a href="#t:Location" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Location:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Test-Chell.html#t:Location">Location</a> -> <a href="Test-Chell.html#t:Location">Location</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Test-Chell.html#t:Location">Location</a> -> <a href="Test-Chell.html#t:Location">Location</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Location:Show:2" class="instance expander" onclick="toggleSection('i:id:Location:Show:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Test-Chell.html#t:Location">Location</a></span> <a href="src/Test-Chell-Types.html#line-169" class="link">Source</a> <a href="#t:Location" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Location:Show:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Test-Chell.html#t:Location">Location</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Test-Chell.html#t:Location">Location</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Test-Chell.html#t:Location">Location</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:location" class="def">location</a> :: <a href="Test-Chell.html#t:Location">Location</a> <a href="src/Test-Chell-Types.html#location" class="link">Source</a> <a href="#v:location" class="selflink">#</a></p><div class="doc"><p>An empty <code><a href="Test-Chell.html#t:Location">Location</a></code>; use the field accessors to populate this value.</p></div></div><div class="top"><p class="src"><a id="v:locationFile" class="def">locationFile</a> :: <a href="Test-Chell.html#t:Location">Location</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="src/Test-Chell-Types.html#locationFile" class="link">Source</a> <a href="#v:locationFile" class="selflink">#</a></p><div class="doc"><p>A path to a source file, or empty if not provided.</p><p><code><a href="Test-Chell.html#v:locationFile">locationFile</a></code> is a field accessor, and can be used to update
a <code><a href="Test-Chell.html#t:Location">Location</a></code> value.</p></div></div><div class="top"><p class="src"><a id="v:locationModule" class="def">locationModule</a> :: <a href="Test-Chell.html#t:Location">Location</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="src/Test-Chell-Types.html#locationModule" class="link">Source</a> <a href="#v:locationModule" class="selflink">#</a></p><div class="doc"><p>A Haskell module name, or empty if not provided.</p><p><code><a href="Test-Chell.html#v:locationModule">locationModule</a></code> is a field accessor, and can be used to update
a <code><a href="Test-Chell.html#t:Location">Location</a></code> value.</p></div></div><div class="top"><p class="src"><a id="v:locationLine" class="def">locationLine</a> :: <a href="Test-Chell.html#t:Location">Location</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a> <a href="src/Test-Chell-Types.html#locationLine" class="link">Source</a> <a href="#v:locationLine" class="selflink">#</a></p><div class="doc"><p>A line number, or Nothing if not provided.</p><p><code><a href="Test-Chell.html#v:locationLine">locationLine</a></code> is a field accessor, and can be used to update
a <code><a href="Test-Chell.html#t:Location">Location</a></code> value.</p></div></div><h2 id="g:10">Test options</h2><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:TestOptions" class="def">TestOptions</a> <a href="src/Test-Chell-Types.html#TestOptions" class="link">Source</a> <a href="#t:TestOptions" class="selflink">#</a></p><div class="doc"><p>Test options are passed to each test, and control details about how the
test should be run.</p></div><div class="subs instances"><p id="control.i:TestOptions" class="caption collapser" onclick="toggleSection('i:TestOptions')">Instances</p><div id="section.i:TestOptions" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:TestOptions:Eq:1" class="instance expander" onclick="toggleSection('i:id:TestOptions:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Test-Chell.html#t:TestOptions">TestOptions</a></span> <a href="src/Test-Chell-Types.html#line-83" class="link">Source</a> <a href="#t:TestOptions" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:TestOptions:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:TestOptions:Show:2" class="instance expander" onclick="toggleSection('i:id:TestOptions:Show:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Test-Chell.html#t:TestOptions">TestOptions</a></span> <a href="src/Test-Chell-Types.html#line-83" class="link">Source</a> <a href="#t:TestOptions" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:TestOptions:Show:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Test-Chell.html#t:TestOptions">TestOptions</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:defaultTestOptions" class="def">defaultTestOptions</a> :: <a href="Test-Chell.html#t:TestOptions">TestOptions</a> <a href="src/Test-Chell-Types.html#defaultTestOptions" class="link">Source</a> <a href="#v:defaultTestOptions" class="selflink">#</a></p><div class="doc"><p>Default test options.</p><pre>$ ghci
Prelude> import Test.Chell
Test.Chell> testOptionSeed defaultTestOptions
0
Test.Chell> testOptionTimeout defaultTestOptions
Nothing</pre></div></div><div class="top"><p class="src"><a id="v:testOptionSeed" class="def">testOptionSeed</a> :: <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="src/Test-Chell-Types.html#testOptionSeed" class="link">Source</a> <a href="#v:testOptionSeed" class="selflink">#</a></p><div class="doc"><p>Get the RNG seed for this test run. The seed is generated once, in
<code>defaultMain</code>, and used for all tests. It is also logged to reports
using a note.</p><p>When using <code>defaultMain</code>, users may specify a seed using the
<code>--seed</code> command-line option.</p><p><code><a href="Test-Chell.html#v:testOptionSeed">testOptionSeed</a></code> is a field accessor, and can be used to update
a <code><a href="Test-Chell.html#t:TestOptions">TestOptions</a></code> value.</p></div></div><div class="top"><p class="src"><a id="v:testOptionTimeout" class="def">testOptionTimeout</a> :: <a href="Test-Chell.html#t:TestOptions">TestOptions</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="src/Test-Chell-Types.html#testOptionTimeout" class="link">Source</a> <a href="#v:testOptionTimeout" class="selflink">#</a></p><div class="doc"><p>An optional timeout, in millseconds. Tests which run longer than
this timeout will be aborted.</p><p>When using <code>defaultMain</code>, users may specify a timeout using the
<code>--timeout</code> command-line option.</p><p><code><a href="Test-Chell.html#v:testOptionTimeout">testOptionTimeout</a></code> is a field accessor, and can be used to update
a <code><a href="Test-Chell.html#t:TestOptions">TestOptions</a></code> value.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|