/usr/share/doc/racket/rackunit/internals.html is in racket-doc 6.7-3.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>5 RackUnit Internals and Extension API</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Rack<span class="mywbr"> </span>Unit:<span class="mywbr"> </span> Unit Testing</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="quick-start.html" class="tocviewlink" data-pltdoc="x">Quick Start Guide for Rack<span class="mywbr"> </span>Unit</a></td></tr><tr><td align="right">2 </td><td><a href="philosophy.html" class="tocviewlink" data-pltdoc="x">The Philosophy of Rack<span class="mywbr"> </span>Unit</a></td></tr><tr><td align="right">3 </td><td><a href="api.html" class="tocviewlink" data-pltdoc="x">Rack<span class="mywbr"> </span>Unit API</a></td></tr><tr><td align="right">4 </td><td><a href="Testing_Utilities.html" class="tocviewlink" data-pltdoc="x">Testing Utilities</a></td></tr><tr><td align="right">5 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Rack<span class="mywbr"> </span>Unit Internals and Extension API</a></td></tr><tr><td align="right">6 </td><td><a href="Release_Notes.html" class="tocviewlink" data-pltdoc="x">Release Notes</a></td></tr><tr><td align="right">7 </td><td><a href="Acknowlegements.html" class="tocviewlink" data-pltdoc="x">Acknowlegements</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">►</a></td><td>5 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Rack<span class="mywbr"> </span>Unit Internals and Extension API</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">5.1 </td><td><a href="#%28part._.Customizing_.Check_.Evaluation%29" class="tocviewlink" data-pltdoc="x">Customizing Check Evaluation</a></td></tr><tr><td align="right">5.2 </td><td><a href="#%28part._.Customizing_.Test_.Evaluation%29" class="tocviewlink" data-pltdoc="x">Customizing Test Evaluation</a></td></tr><tr><td align="right">5.3 </td><td><a href="#%28part._running%29" class="tocviewlink" data-pltdoc="x">Programmatically Running Tests and Inspecting Results</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">5.1<tt> </tt></span><a href="#%28part._.Customizing_.Check_.Evaluation%29" class="tocsubseclink" data-pltdoc="x">Customizing Check Evaluation</a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-check-handler%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>check-<wbr></wbr>handler</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-check-around%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>check-<wbr></wbr>around</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.2<tt> </tt></span><a href="#%28part._.Customizing_.Test_.Evaluation%29" class="tocsubseclink" data-pltdoc="x">Customizing Test Evaluation</a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-test-name%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>test-<wbr></wbr>name</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-test-case-around%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>test-<wbr></wbr>case-<wbr></wbr>around</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-suite-test-case-around%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">test-<wbr></wbr>suite-<wbr></wbr>test-<wbr></wbr>case-<wbr></wbr>around</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-suite-check-around%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">test-<wbr></wbr>suite-<wbr></wbr>check-<wbr></wbr>around</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.3<tt> </tt></span><a href="#%28part._running%29" class="tocsubseclink" data-pltdoc="x">Programmatically Running Tests and Inspecting Results</a></td></tr><tr><td><span class="tocsublinknumber">5.3.1<tt> </tt></span><a href="#%28part._.Result_.Types%29" class="tocsubseclink" data-pltdoc="x">Result Types</a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._exn~3atest%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">exn:<span class="mywbr"> </span>test</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._exn~3atest~3acheck%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">exn:<span class="mywbr"> </span>test:<span class="mywbr"> </span>check</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-result%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">test-<wbr></wbr>result</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-failure%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">test-<wbr></wbr>failure</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-error%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">test-<wbr></wbr>error</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-success%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">test-<wbr></wbr>success</span></span></a></td></tr><tr><td><span class="tocsublinknumber">5.3.2<tt> </tt></span><a href="#%28part._.Functions_to_.Run_.Tests%29" class="tocsubseclink" data-pltdoc="x">Functions to Run Tests</a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._run-test-case%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">run-<wbr></wbr>test-<wbr></wbr>case</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._run-test%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">run-<wbr></wbr>test</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._fold-test-results%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">fold-<wbr></wbr>test-<wbr></wbr>results</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._foldts-test-suite%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">foldts-<wbr></wbr>test-<wbr></wbr>suite</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="Testing_Utilities.html" title="backward to "4 Testing Utilities"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "RackUnit: Unit Testing"" data-pltdoc="x">up</a> <a href="Release_Notes.html" title="forward to "6 Release Notes"" data-pltdoc="x">next →</a></span> </div><h3 x-source-module="(lib "rackunit/scribblings/rackunit.scrbl")" x-source-pkg="rackunit-doc" x-part-tag=""internals"">5<tt> </tt><a name="(part._internals)"></a>RackUnit Internals and Extension API</h3><p>This section describes RackUnit’s facilities for customizing the
behavior of checks and tests and for creating new kinds of test
runners.</p><h4 x-source-module="(lib "rackunit/scribblings/rackunit.scrbl")" x-source-pkg="rackunit-doc" x-part-tag=""Customizing_Check_Evaluation"">5.1<tt> </tt><a name="(part._.Customizing_.Check_.Evaluation)"></a>Customizing Check Evaluation</h4><p>The semantics of checks are determined by the parameters
<span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-check-around%29%29" class="RktValLink" data-pltdoc="x">current-check-around</a></span> and
<span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-check-handler%29%29" class="RktValLink" data-pltdoc="x">current-check-handler</a></span>. Other testing form such as
<span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._test-begin%29%29" class="RktStxLink" data-pltdoc="x">test-begin</a></span> and <span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._test-suite%29%29" class="RktStxLink" data-pltdoc="x">test-suite</a></span> change the value
of these parameters.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._rackunit/main..rkt)._current-check-handler))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-check-handler%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-check-handler</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-check-handler%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-check-handler</a></span></span><span class="hspace"> </span><span class="RktVar">handler</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">handler</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Parameter containing the function that handles exceptions
raised by check failures. The default value is a procedure
that will display the exception data in a user-friendly format.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._rackunit/main..rkt)._current-check-around))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-check-around%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-check-around</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-check-around%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-check-around</a></span></span><span class="hspace"> </span><span class="RktVar">check</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">check</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Parameter containing the function that handles the execution
of checks. The default value wraps the evaluation of
<span class="RktSym">thunk</span> in a <span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=exns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fmore-scheme..rkt%2529._with-handlers%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">with-handlers</a></span> call that calls
<span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-check-handler%29%29" class="RktValLink" data-pltdoc="x">current-check-handler</a></span> if an exception is raised and then
(when an exception is not raised) discards the result, returning
<span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">void</a></span><span class="RktPn">)</span>.</div></p><h4 x-source-module="(lib "rackunit/scribblings/rackunit.scrbl")" x-source-pkg="rackunit-doc" x-part-tag=""Customizing_Test_Evaluation"">5.2<tt> </tt><a name="(part._.Customizing_.Test_.Evaluation)"></a>Customizing Test Evaluation</h4><p>Just like with checks, there are several parameters that
control the semantics of compound testing forms.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._rackunit/main..rkt)._current-test-name))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-test-name%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-test-name</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._false%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">false/c</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-test-name%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-test-name</a></span></span><span class="hspace"> </span><span class="RktVar">name</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">name</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._false%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">false/c</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">This parameter stores the name of the current test case. A
value of <span class="RktVal">#f</span> indicates a test case with no name,
such as one constructed by <span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._test-begin%29%29" class="RktStxLink" data-pltdoc="x">test-begin</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._rackunit/main..rkt)._current-test-case-around))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-test-case-around%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-test-case-around</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-test-case-around%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-test-case-around</a></span></span><span class="hspace"> </span><span class="RktVar">handler</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">handler</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">This parameter handles evaluation of test cases. The value
of the parameter is a function that is passed a thunk (a
function of no arguments). The function, when applied,
evaluates the expressions within a test case. The default
value of the <span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-test-case-around%29%29" class="RktValLink" data-pltdoc="x">current-test-case-around</a></span> parameters
evaluates the thunk in a context that catches exceptions and
prints an appropriate message indicating test case failure.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._rackunit/main..rkt)._test-suite-test-case-around))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-suite-test-case-around%29%29" class="RktValDef RktValLink" data-pltdoc="x">test-suite-test-case-around</a></span></span><span class="hspace"> </span><span class="RktVar">thunk</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">thunk</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">The <span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-test-case-around%29%29" class="RktValLink" data-pltdoc="x">current-test-case-around</a></span> parameter is
parameterized to this value within the scope of a
<span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._test-suite%29%29" class="RktStxLink" data-pltdoc="x">test-suite</a></span>. This function creates a test case
structure instead of immediately evaluating the thunk.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._rackunit/main..rkt)._test-suite-check-around))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-suite-check-around%29%29" class="RktValDef RktValLink" data-pltdoc="x">test-suite-check-around</a></span></span><span class="hspace"> </span><span class="RktVar">thunk</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">any/c</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">thunk</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">The <span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-check-around%29%29" class="RktValLink" data-pltdoc="x">current-check-around</a></span> parameter is parameterized
to this value within the scope of a <span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._test-suite%29%29" class="RktStxLink" data-pltdoc="x">test-suite</a></span>.
This function creates a test case structure instead of
immediately evaluating a check.</div></p><h4 x-source-module="(lib "rackunit/scribblings/rackunit.scrbl")" x-source-pkg="rackunit-doc" x-part-tag=""running"">5.3<tt> </tt><a name="(part._running)"></a>Programmatically Running Tests and Inspecting Results</h4><p>RackUnit provides an API for running tests, from which
custom UIs can be created.</p><h5 x-source-module="(lib "rackunit/scribblings/rackunit.scrbl")" x-source-pkg="rackunit-doc" x-part-tag=""Result_Types"">5.3.1<tt> </tt><a name="(part._.Result_.Types)"></a>Result Types</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>struct</p></div></div><table cellspacing="0" cellpadding="0" class="RForeground"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span></td><td><span class="hspace"> </span></td><td><a name="(def._((lib._rackunit/main..rkt)._make-exn~3atest))"></a><a name="(def._((lib._rackunit/main..rkt)._exn~3atest~3f))"></a><a name="(def._((lib._rackunit/main..rkt)._struct~3aexn~3atest))"></a><a name="(def._((lib._rackunit/main..rkt)._exn~3atest))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._exn~3atest%29%29" class="RktValDef RktValLink" data-pltdoc="x">exn:test</a></span></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=exns.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._exn%7E3afail%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">exn:fail</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:extra-constructor-name</span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._make-exn~3atest%29%29" class="RktValLink" data-pltdoc="x">make-exn:test</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">The base structure for RackUnit exceptions. You should
never catch instances of this type, only the subtypes
documented below.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>struct</p></div></div><table cellspacing="0" cellpadding="0" class="RForeground"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span></td><td><span class="hspace"> </span></td><td><a name="(def._((lib._rackunit/main..rkt)._exn~3atest~3acheck-stack))"></a><a name="(def._((lib._rackunit/main..rkt)._make-exn~3atest~3acheck))"></a><a name="(def._((lib._rackunit/main..rkt)._exn~3atest~3acheck~3f))"></a><a name="(def._((lib._rackunit/main..rkt)._struct~3aexn~3atest~3acheck))"></a><a name="(def._((lib._rackunit/main..rkt)._exn~3atest~3acheck))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._exn~3atest~3acheck%29%29" class="RktValDef RktValLink" data-pltdoc="x">exn:test:check</a></span></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._exn~3atest%29%29" class="RktValLink" data-pltdoc="x">exn:test</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">stack</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:extra-constructor-name</span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._make-exn~3atest~3acheck%29%29" class="RktValLink" data-pltdoc="x">make-exn:test:check</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">stack</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._listof%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="api.html#%28def._%28%28lib._rackunit%2Fmain..rkt%29._check-info%29%29" class="RktValLink" data-pltdoc="x">check-info</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A <span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._exn~3atest~3acheck%29%29" class="RktValLink" data-pltdoc="x">exn:test:check</a></span> is raised when an check fails, and
contains the contents of the check-info stack at the
time of failure.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>struct</p></div></div><table cellspacing="0" cellpadding="0" class="RForeground"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span></td><td><span class="hspace"> </span></td><td><a name="(def._((lib._rackunit/main..rkt)._test-result-test-case-name))"></a><a name="(def._((lib._rackunit/main..rkt)._make-test-result))"></a><a name="(def._((lib._rackunit/main..rkt)._test-result~3f))"></a><a name="(def._((lib._rackunit/main..rkt)._struct~3atest-result))"></a><a name="(def._((lib._rackunit/main..rkt)._test-result))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-result%29%29" class="RktValDef RktValLink" data-pltdoc="x">test-result</a></span></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">test-case-name</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:extra-constructor-name</span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._make-test-result%29%29" class="RktValLink" data-pltdoc="x">make-test-result</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">test-case-name</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">A test-result is the result of running the test with
the given name (with <span class="RktVal">#f</span> indicating no name is available).</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>struct</p></div></div><table cellspacing="0" cellpadding="0" class="RForeground"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span></td><td><span class="hspace"> </span></td><td><a name="(def._((lib._rackunit/main..rkt)._test-failure-result))"></a><a name="(def._((lib._rackunit/main..rkt)._make-test-failure))"></a><a name="(def._((lib._rackunit/main..rkt)._test-failure~3f))"></a><a name="(def._((lib._rackunit/main..rkt)._struct~3atest-failure))"></a><a name="(def._((lib._rackunit/main..rkt)._test-failure))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-failure%29%29" class="RktValDef RktValLink" data-pltdoc="x">test-failure</a></span></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-result%29%29" class="RktValLink" data-pltdoc="x">test-result</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">result</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:extra-constructor-name</span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._make-test-failure%29%29" class="RktValLink" data-pltdoc="x">make-test-failure</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">result</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Subtype of test-result representing a test failure.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>struct</p></div></div><table cellspacing="0" cellpadding="0" class="RForeground"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span></td><td><span class="hspace"> </span></td><td><a name="(def._((lib._rackunit/main..rkt)._test-error-result))"></a><a name="(def._((lib._rackunit/main..rkt)._make-test-error))"></a><a name="(def._((lib._rackunit/main..rkt)._test-error~3f))"></a><a name="(def._((lib._rackunit/main..rkt)._struct~3atest-error))"></a><a name="(def._((lib._rackunit/main..rkt)._test-error))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-error%29%29" class="RktValDef RktValLink" data-pltdoc="x">test-error</a></span></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-result%29%29" class="RktValLink" data-pltdoc="x">test-result</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">result</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:extra-constructor-name</span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._make-test-error%29%29" class="RktValLink" data-pltdoc="x">make-test-error</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">result</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=exns.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._exn%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">exn</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Subtype of test-result representing a test error.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>struct</p></div></div><table cellspacing="0" cellpadding="0" class="RForeground"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define-struct.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._struct%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">struct</a></span></td><td><span class="hspace"> </span></td><td><a name="(def._((lib._rackunit/main..rkt)._test-success-result))"></a><a name="(def._((lib._rackunit/main..rkt)._make-test-success))"></a><a name="(def._((lib._rackunit/main..rkt)._test-success~3f))"></a><a name="(def._((lib._rackunit/main..rkt)._struct~3atest-success))"></a><a name="(def._((lib._rackunit/main..rkt)._test-success))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-success%29%29" class="RktValDef RktValLink" data-pltdoc="x">test-success</a></span></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-result%29%29" class="RktValLink" data-pltdoc="x">test-result</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">result</span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:extra-constructor-name</span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._make-test-success%29%29" class="RktValLink" data-pltdoc="x">make-test-success</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">result</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Subtype of test-result representing a test success.</div></p><h5 x-source-module="(lib "rackunit/scribblings/rackunit.scrbl")" x-source-pkg="rackunit-doc" x-part-tag=""Functions_to_Run_Tests"">5.3.2<tt> </tt><a name="(part._.Functions_to_.Run_.Tests)"></a>Functions to Run Tests</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._rackunit/main..rkt)._run-test-case))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._run-test-case%29%29" class="RktValDef RktValLink" data-pltdoc="x">run-test-case</a></span></span><span class="hspace"> </span><span class="RktVar">name</span><span class="hspace"> </span><span class="RktVar">action</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-result%29%29" class="RktValLink" data-pltdoc="x">test-result</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">name</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">action</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Runs the given test case, returning a result representing success,
failure, or error.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._rackunit/main..rkt)._run-test))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._run-test%29%29" class="RktValDef RktValLink" data-pltdoc="x">run-test</a></span></span><span class="hspace"> </span><span class="RktVar">test</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._flat-murec-contract%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">flat-murec-contract</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">R</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._listof%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-result~3f%29%29" class="RktValLink" data-pltdoc="x">test-result?</a></span><span class="hspace"> </span><span class="RktSym">R</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">R</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">test</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="api.html#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-case~3f%29%29" class="RktValLink" data-pltdoc="x">test-case?</a></span><span class="hspace"> </span><span class="RktSym"><a href="api.html#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-suite~3f%29%29" class="RktValLink" data-pltdoc="x">test-suite?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Runs the given test (test case or test suite) returning a
tree (list of lists) of results</div></p><p>Example:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._run-test%29%29" class="RktValLink" data-pltdoc="x">run-test</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._test-suite%29%29" class="RktStxLink" data-pltdoc="x">test-suite</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">"Dummy"</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._test-case%29%29" class="RktStxLink" data-pltdoc="x">test-case</a></span><span class="hspace"> </span><span class="RktVal">"Dummy"</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="api.html#%28def._%28%28lib._rackunit%2Fmain..rkt%29._check-equal~3f%29%29" class="RktValLink" data-pltdoc="x">check-equal?</a></span><span class="hspace"> </span><span class="RktVal">1</span><span class="hspace"> </span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((lib._rackunit/main..rkt)._fold-test-results))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._fold-test-results%29%29" class="RktValDef RktValLink" data-pltdoc="x">fold-test-results</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">result-fn</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">seed</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">test</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:run</span><span class="hspace"> </span><span class="RktVar">run</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:fdown</span><span class="hspace"> </span><span class="RktVar">fdown</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:fup</span><span class="hspace"> </span><span class="RktVar">fup</span><span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVal">'</span><span class="RktVal">a</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">result-fn</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktVal">'</span><span class="RktVal">b</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">c</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">seed</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">test</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="api.html#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-case~3f%29%29" class="RktValLink" data-pltdoc="x">test-case?</a></span><span class="hspace"> </span><span class="RktSym"><a href="api.html#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-suite~3f%29%29" class="RktValLink" data-pltdoc="x">test-suite?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">run</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">b</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">c</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=stx-patterns.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fstxcase-scheme..rkt%2529._......%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">...</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">fdown</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">fup</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Fold <span class="RktVar">result-fn</span> pre-order left-to-right depth-first
over the results of <span class="RktVar">run</span>. By default <span class="RktVar">run</span>
is <span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._run-test-case%29%29" class="RktValLink" data-pltdoc="x">run-test-case</a></span> and <span class="RktVar">fdown</span> and
<span class="RktVar">fup</span> just return the seed, so <span class="RktVar">result-fn</span> is
folded over the test results.</div></p><p>This function is useful for writing custom folds (and hence UIs) over
test results without you having to take care of all the expected setup
and teardown. For example, <span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._fold-test-results%29%29" class="RktValLink" data-pltdoc="x">fold-test-results</a></span> will run test
suite before and after actions for you. However it is still flexible
enough, via its keyword arguments, to do almost anything that
<span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._foldts-test-suite%29%29" class="RktValLink" data-pltdoc="x">foldts-test-suite</a></span> can. Hence it should be used in preference to <span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._foldts-test-suite%29%29" class="RktValLink" data-pltdoc="x">foldts-test-suite</a></span>.</p><p>The <span class="RktVar">result-fn</span> argument is a function from the results of
<span class="RktVar">run</span> (defaults to a <span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-result%29%29" class="RktValLink" data-pltdoc="x">test-result</a></span>) and the seed to a
new seed.</p><p>The <span class="RktVar">seed</span> argument is any value.</p><p>The <span class="RktVar">test</span> argument is a test case or test suite.</p><p>The <span class="RktVar">run</span> argument is a function from a test case name (string)
and action (thunk) to any values. The values produced by <span class="RktVar">run</span>
are fed into the <span class="RktVar">result-fn</span>.</p><p>The <span class="RktVar">fdown</span> argument is a function from a test suite name
(string) and the seed, to a new seed.</p><p>The <span class="RktVar">fup</span> argument is a function from a test suite name
(string) and the seed, to a new seed.</p><p>Examples:</p><p>The following code counts the number of successes:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">count-successes</span><span class="hspace"> </span><span class="RktSym">test</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._fold-test-results%29%29" class="RktValLink" data-pltdoc="x">fold-test-results</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">result</span><span class="hspace"> </span><span class="RktSym">seed</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=if.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._if%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-success~3f%29%29" class="RktValLink" data-pltdoc="x">test-success?</a></span><span class="hspace"> </span><span class="RktSym">result</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=generic-numbers.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._add1%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">add1</a></span><span class="hspace"> </span><span class="RktSym">seed</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">seed</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">test</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>The following code returns the symbol <span class="RktVal">'</span><span class="RktVal">burp</span> instead
of running test cases. Note how the <span class="RktSym">result-fn</span> receives the
value of <span class="RktSym">run</span>.</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">burp</span><span class="hspace"> </span><span class="RktSym">test</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._fold-test-results%29%29" class="RktValLink" data-pltdoc="x">fold-test-results</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">result</span><span class="hspace"> </span><span class="RktSym">seed</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._cons%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons</a></span><span class="hspace"> </span><span class="RktSym">result</span><span class="hspace"> </span><span class="RktSym">seed</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=pairs.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._null%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">null</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">test</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">#:run</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">name</span><span class="hspace"> </span><span class="RktSym">action</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">burp</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._rackunit/main..rkt)._foldts-test-suite))"></a><span title="Provided from: rackunit | Package: rackunit-lib"><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._foldts-test-suite%29%29" class="RktValDef RktValLink" data-pltdoc="x">foldts-test-suite</a></span></span><span class="hspace"> </span><span class="RktVar">fdown</span><span class="hspace"> </span><span class="RktVar">fup</span><span class="hspace"> </span><span class="RktVar">fhere</span><span class="hspace"> </span><span class="RktVar">seed</span><span class="hspace"> </span><span class="RktVar">test</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">fdown</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._test-suite%29%29" class="RktStxLink" data-pltdoc="x">test-suite</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string</a></span><span class="hspace"> </span><span class="RktSym">thunk</span><span class="hspace"> </span><span class="RktSym">thunk</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">fup</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._test-suite%29%29" class="RktStxLink" data-pltdoc="x">test-suite</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string</a></span><span class="hspace"> </span><span class="RktSym">thunk</span><span class="hspace"> </span><span class="RktSym">thunk</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">fhere</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._test-case%29%29" class="RktStxLink" data-pltdoc="x">test-case</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string</a></span><span class="hspace"> </span><span class="RktSym">thunk</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">seed</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">a</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">test</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="api.html#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-case~3f%29%29" class="RktValLink" data-pltdoc="x">test-case?</a></span><span class="hspace"> </span><span class="RktSym"><a href="api.html#%28def._%28%28lib._rackunit%2Fmain..rkt%29._test-suite~3f%29%29" class="RktValLink" data-pltdoc="x">test-suite?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">The <span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._foldts-test-suite%29%29" class="RktValLink" data-pltdoc="x">foldts-test-suite</a></span> function is a nifty tree fold (created by Oleg
Kiselyov) that folds over a test in a useful way
(<span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._fold-test-results%29%29" class="RktValLink" data-pltdoc="x">fold-test-results</a></span> isn’t that useful as you can’t specify
actions around test cases).</div></p><p>The <span class="RktVar">fdown</span> argument is a function of test suite, test suite
name, before action, after action, and the seed. It is run when a
test suite is encountered on the way down the tree (pre-order).</p><p>The <span class="RktVar">fup</span> argument is a function of test suite, test suite
name, before action, after action, the seed at the current level, and
the seed returned by the children. It is run on the way up the tree
(post-order).</p><p>The <span class="RktVar">fhere</span> argument is a function of the test case, test case
name, the test case action, and the seed. (Note that this might change
in the near future to just the test case. This change would be to
allow <span class="RktVar">fhere</span> to discriminate subtypes of test-case, which in
turn would allow test cases that are, for example, ignored).</p><p>Example:</p><p>Here’s the implementation of <span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._fold-test-results%29%29" class="RktValLink" data-pltdoc="x">fold-test-results</a></span> in terms of
<span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._foldts-test-suite%29%29" class="RktValLink" data-pltdoc="x">foldts-test-suite</a></span>:</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._fold-test-results%29%29" class="RktValLink" data-pltdoc="x">fold-test-results</a></span><span class="hspace"> </span><span class="RktSym">suite-fn</span><span class="hspace"> </span><span class="RktSym">case-fn</span><span class="hspace"> </span><span class="RktSym">seed</span><span class="hspace"> </span><span class="RktSym">test</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._foldts-test-suite%29%29" class="RktValLink" data-pltdoc="x">foldts-test-suite</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">suite</span><span class="hspace"> </span><span class="RktSym">name</span><span class="hspace"> </span><span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._before%29%29" class="RktStxLink" data-pltdoc="x">before</a></span><span class="hspace"> </span><span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._after%29%29" class="RktStxLink" data-pltdoc="x">after</a></span><span class="hspace"> </span><span class="RktSym">seed</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._before%29%29" class="RktStxLink" data-pltdoc="x">before</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">suite-fn</span><span class="hspace"> </span><span class="RktSym">name</span><span class="hspace"> </span><span class="RktSym">seed</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">suite</span><span class="hspace"> </span><span class="RktSym">name</span><span class="hspace"> </span><span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._before%29%29" class="RktStxLink" data-pltdoc="x">before</a></span><span class="hspace"> </span><span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._after%29%29" class="RktStxLink" data-pltdoc="x">after</a></span><span class="hspace"> </span><span class="RktSym">seed</span><span class="hspace"> </span><span class="RktSym">kid-seed</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._after%29%29" class="RktStxLink" data-pltdoc="x">after</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">kid-seed</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=lambda.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._lambda%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=case.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fmore-scheme..rkt%2529._case%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">case</a></span><span class="hspace"> </span><span class="RktSym">name</span><span class="hspace"> </span><span class="RktSym">action</span><span class="hspace"> </span><span class="RktSym">seed</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">case-fn</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._run-test-case%29%29" class="RktValLink" data-pltdoc="x">run-test-case</a></span><span class="hspace"> </span><span class="RktSym">name</span><span class="hspace"> </span><span class="RktSym">action</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">seed</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">seed</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym">test</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>If you’re used to folds you’ll probably be a bit surprised that the
functions you pass to <span class="RktSym"><a href="#%28def._%28%28lib._rackunit%2Fmain..rkt%29._foldts-test-suite%29%29" class="RktValLink" data-pltdoc="x">foldts-test-suite</a></span> receive both the structure they
operate on, and the contents of that structure. This is indeed
unusual. It is done to allow subtypes of test-case and test-suite to
be run in customised ways. For example, you might define subtypes of
test case that are ignored (not run), or have their execution time
recorded, and so on. To do so the functions that run the test cases
need to know what type the test case has, and hence is is necessary to
provide this information.</p><p>If you’ve made it this far you truly are a master RackUnit hacker. As
a bonus prize we’ll just mention that the code in
<span class="stt">hash-monad.rkt</span> and <span class="stt">monad.rkt</span> might be of
interest for constructing user interfaces. The API is still in flux,
so isn’t documented here. However, do look at the implementation of
<span class="RktSym"><a href="api.html#%28def._%28%28lib._rackunit%2Ftext-ui..rkt%29._run-tests%29%29" class="RktValLink" data-pltdoc="x">run-tests</a></span> for examples of use.</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="Testing_Utilities.html" title="backward to "4 Testing Utilities"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "RackUnit: Unit Testing"" data-pltdoc="x">up</a> <a href="Release_Notes.html" title="forward to "6 Release Notes"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|