'C8      !"#$%&'()*+,-./01234567 Safe-Inferred,Simplifies the input string by interpreting \r and \b characters < specially so that the result string has the same final (or terminal, F pun intended) appearance as would the input string when written to a A terminal that overwrites character positions following carriage  returns and backspaces. 8The helper function ta takes an accumulating ShowS-style function  that holds  committed0 lines of text, a (reversed) list of characters  on the current line before+ the cursor, a (normal) list of characters  on the current line after& the cursor, and the remaining input. 8An accumulating ShowS-style function  that holds  committed lines of text  A (reversed) list of characters  on the current line before the cursor A (normal) list of characters  on the current line after the cursor The remaining input 8NoneLWhen an assertion is evaluated, it will output a message if and only if the  assertion fails. ATest cases are composed of a sequence of one or more assertions. 9Unconditionally signals that a failure has occured. All 2 other assertions can be expressed with the form:   if conditionIsMet  then IO ()  else assertFailure msg GPerforms a single test case. The meaning of the result is as follows: Nothing test case success Just (True, msg)* test case failure with the given message Just (False, msg)( test case error with the given message 98A message that is displayed with the assertion failure 2an assertion to be made during the test case run :;9:;NoneComposed into  s. CUniquely describes the location of a test within a test hierarchy. ' Node order is from test case to root. BReport generator for reporting problems that have occurred during = a test run. Problems may be errors or assertion failures. 8Report generator for reporting the start of a test run. KKeeps track of the remaining tests and the results of the performed tests. C As each test is performed, the path is removed and the counts are  updated as appropriate. IA data structure that hold the results of tests that have been performed  up until this point. &Provides a way to convert data into a Test or set of Test. DThe basic structure used to create an annotated tree of test cases. +A name or description for a subtree of the Tests.  A set of Test,s sharing the same level in the hierarchy. *A single, independent test case composed. CUsed to signify that a data type can be converted to an assertion  predicate. $The result of an assertion that hasn't been evaluated yet. ,Most test cases follow the following steps:  " Do some processing or an action.  Assert certain conditions. ,However, this flow is not always suitable. AssertionPredicate allows for K additional steps to be inserted without the initial action to be affected K by side effects. Additionally, clean-up can be done before the test case 1 has a chance to end. A potential work flow is:  Write data to a file. - Read data from a file, evaluate conditions.  Clean up the file. M Assert that the side effects of the read operation meet certain conditions. 9 Assert that the conditions evaluated in step 2 are met. A specialized form of ! to handle lists. !1Allows the extension of the assertion mechanism.  Since an  can be a sequence of  Assertions and IO actions, L there is a fair amount of flexibility of what can be achieved. As a rule,  the resulting  Assertion should be the body of a  or part of  a TestCase9; it should not be used to assert multiple, independent  conditions. 7If more complex arrangements of assertions are needed, s and   should be used. #,Asserts that the specified condition holds. $ESignals an assertion failure if a non-empty message (i.e., a message  other than "" ) is passed. %HAsserts that the specified actual value is equal to the expected value. J The output message will contain the prefix, the expected value, and the  actual value. )If the prefix is the empty string (i.e., ""), then the prefix is omitted 5 and only the expected and actual values are output. &7Asserts that the condition obtained from the specified   holds. 'GAsserts that the specified actual value is equal to the expected value 4 (with the expected value on the left-hand side). (GAsserts that the specified actual value is equal to the expected value 2 (with the actual value on the left-hand side). )ECreates a test case resulting from asserting the condition obtained  from the specified . *DShorthand for a test case that asserts equality (with the expected G value on the left-hand side, and the actual value on the right-hand  side). +BShorthand for a test case that asserts equality (with the actual I value on the left-hand side, and the expected value on the right-hand  side). ,"Creates a test from the specified , with the specified  label attached to it. Since  is Testable3, this can be used as a shorthand way of attaching  a  to one or more tests. -Determines the paths for all s in a tree of Tests. .Counts the number of s in a tree of Tests. /<Performs a test run with the specified report generators. JThis handles the actual running of the tests. Most developers will want  to use HUnit.Text.runTestTT0 instead. A developer could use this function J to execute tests via another IO system, such as a GUI, or to output the I results in a different manner (e.g., upload XML-formatted results to a  webservice). DNote that the counts in a start report do not include the test case F being started, whereas the counts in a problem report do include the H test case just finished. The principle is that the counts are sampled E only between test case executions. As a result, the number of test E case successes always equals the difference of test cases tried and + the sum of test case errors and failures. 5  !"#5The message that is displayed if the assertion fails The condition $:The message that is displayed with the assertion failure %The message prefix The expected value The actual value &6A value of which the asserted condition is predicated 3A message that is displayed if the assertion fails 'The expected value The actual value (The actual value The expected value )6A value of which the asserted condition is predicated ,A message that is displayed on test failure *The expected value The actual value +The actual value The expected value ,-./)report generator for the test run start 0report generator for errors during the test run <report generator for assertion failures during the test run the test to be executed <=>?@ABCDEF,  !"#$%&'()*+,-./,*+,)#%$'(&!"   -. /$   !"#$%&'()*+,-./<=>?@ABCDEFNone0+As the general text-based test controller (4 ) executes a @ test, it reports each test case start, error, and failure by F constructing a string and passing it to the function embodied in a  0!. A report string is known as a "line", although it includes ) no line terminator; the function in a 0 is responsible for D terminating lines appropriately. Besides the line, the function + receives a flag indicating the intended " persistence" of the line:  G= indicates that the line should be part of the final overall  report; H6 indicates that the line merely indicates progress of G the test execution. Each progress line shows the current values of H the cumulative test execution counts; a final, persistent line shows  the final count values. The 0: function is also passed, and returns, an arbitrary state  value (called st1 here). The initial state value is given in the  0!; the final value is returned by 4. 2)Two reporting schemes are defined here. putTextToHandle writes " report lines to a given handle. 3 accumulates + persistent lines for return as a whole by 4. putTextToHandle. writes persistent lines to the given handle, H following each by a newline character. In addition, if the given flag  is True>, it writes progress lines to the handle as well. A progress = line is written with no line termination, so that it can be G overwritten by the next report line. As overwriting involves writing D carriage return and blank characters, its proper effect is usually $ only obtained on terminal devices. 3EAccumulates persistent lines (dropping progess lines) for return by  4/. The accumulated lines are represented by a  I (J -> J)& function whose first argument is the : string to be appended to the accumulated report lines. 4EExecutes a test, processing each report line according to the given * reporting scheme. The reporting scheme'#s state is threaded through calls  to the reporting scheme'3s function and finally returned, along with final  count values. 5,Converts test execution counts to a string. 6HConverts a test case path to a string, separating adjacent elements by  the colon (':'-). An element of the path is quoted (as with K) when ! there is potential ambiguity. 7 Provides the "standard"2 text-based test controller. Reporting is made to D standard error, and progress reports are included. For possible 4 programmatic use, the final counts are returned. The "TT" in the name suggests "$Text-based reporting to the Terminal". 012!Write progress lines to handle? 34567012345670123465701234567None4  !"#$%&'()*+,-./01234567L      !"#$%&'()*+,-./01233456789:;<=>?@ABCDEFGHIJKIJLMNOMPQMNRS HUnit-1.2.5.2Test.HUnit.TerminalTest.HUnit.LangTest.HUnit.BaseTest.HUnit.Text Test.HUnitterminalAppearance HUnitFailure Assertion assertFailureperformTestCaseNodeLabelListItemPath ReportProblem ReportStartStatepathcountsCountscasestriederrorsfailuresTestabletestTest TestLabelTestListTestCaseAssertionPredicableassertionPredicateAssertionPredicateListAssertable listAssert Assertableassert assertBool assertString assertEqual@?@=?@?=~?~=?~?=~: testCasePaths testCaseCount performTestPutTextputTextToHandleputTextToShowS runTestText showCountsshowPath runTestTTtahunitFailureTc$fExceptionHUnitFailure$fTypeableHUnitFailure $fTestable[] $fTestableIO$fTestableTest $fShowTest$fAssertionPredicableIO$fAssertionPredicableBool$fListAssertableChar$fAssertableIO$fAssertable[]$fAssertableBool$fAssertable()ghc-prim GHC.TypesTrueFalsebaseGHC.ShowShowSGHC.BaseStringshow