<!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.HUnit.Lang</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ window.onload = function () {pageLoad();setSynopsis("mini_Test-HUnit-Lang.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Test-HUnit-Lang.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">HUnit-1.2.2.3: A unit testing framework for Haskell</p></div><div id="content"><div id="module-header"><p class="caption">Test.HUnit.Lang</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module abstracts the differences between implementations of Haskell (e.g., GHC, Hugs, and NHC). </p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">type</span> <a href="#t:Assertion">Assertion</a> = <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:assertFailure">assertFailure</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> -> <a href="Test-HUnit-Lang.html#t:Assertion">Assertion</a></li><li class="src short"><a href="#v:performTestCase">performTestCase</a> :: <a href="Test-HUnit-Lang.html#t:Assertion">Assertion</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>))</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Assertion" class="def">Assertion</a> = <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/Test-HUnit-Lang.html#Assertion" class="link">Source</a></p><div class="doc"><p>When an assertion is evaluated, it will output a message if and only if the assertion fails. </p><p>Test cases are composed of a sequence of one or more assertions. </p></div></div><div class="top"><p class="src"><a name="v:assertFailure" class="def">assertFailure</a><a href="src/Test-HUnit-Lang.html#assertFailure" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></td><td class="doc"><p>A message that is displayed with the assertion failure </p></td></tr><tr><td class="src">-> <a href="Test-HUnit-Lang.html#t:Assertion">Assertion</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Unconditionally signals that a failure has occured. All other assertions can be expressed with the form: </p><pre> if conditionIsMet then IO () else assertFailure msg </pre></div></div><div class="top"><p class="src"><a name="v:performTestCase" class="def">performTestCase</a><a href="src/Test-HUnit-Lang.html#performTestCase" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Test-HUnit-Lang.html#t:Assertion">Assertion</a></td><td class="doc"><p>an assertion to be made during the test case run </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>))</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Performs a single test case. The meaning of the result is as follows: </p><dl><dt><code>Nothing</code></dt><dd> test case success </dd><dt><code>Just (True, msg)</code></dt><dd> test case failure with the given message </dd><dt><code>Just (False, msg)</code></dt><dd> test case error with the given message </dd></dl></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>