úΜr–º[      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZSafe [\]^_`abcdefg\bcdefg [\]^_`abcdefgSafe,Simplifies the input string by interpreting \r and \bH characters specially so that the result string has the same final (or terminal¡, pun intended) appearance as would the input string when written to a terminal that overwrites character positions following carriage returns and backspaces.hThe helper function ta takes an accumulating ShowS-style function that holds  committedE 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.hAn accumulating ShowS-style function that holds  committed lines of text5A (reversed) list of characters on the current line before the cursor3A (normal) list of characters on the current line after the cursorThe remaining inputhSafe*0: ]When an assertion is evaluated, it will output a message if and only if the assertion fails.@Test cases are composed of a sequence of one or more assertions. jUnconditionally signals that a failure has occured. All other assertions can be expressed with the form: E if conditionIsMet then IO () else assertFailure msg ŸAsserts that the specified actual value is equal to the expected value. The output message will contain the prefix, the expected value, and the actual value.)If the prefix is the empty string (i.e., ""R), then the prefix is omitted and only the expected and actual values are output.Performs a single test case. i 6A message that is displayed with the assertion failure The message prefixThe expected valueThe actual value 0an assertion to be made during the test case run     i Safe*:Composed into s.iUniquely describes the location of a test within a test hierarchy. Node order is from test case to root.~Report generator for reporting problems that have occurred during a test run. Problems may be errors or assertion failures.7Report generator for reporting the start of a test run.¦Keeps track of the remaining tests and the results of the performed tests. As each test is performed, the path is removed and the counts are updated as appropriate. ^A 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.(CThe basic structure used to create an annotated tree of test cases.))A single, independent test case composed.* A set of Test*s sharing the same level in the hierarchy.++A name or description for a subtree of the Tests.,MUsed 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 additional steps to be inserted without the initial action to be affected by side effects. Additionally, clean-up can be done before the test case 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.KAssert that the side effects of the read operation meet certain conditions.7Assert that the conditions evaluated in step 2 are met./A specialized form of 1 to handle lists.10Allows the extension of the assertion mechanism. Since an   can be a sequence of  Assertions and IOe actions, 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 TestCaseD; it should not be used to assert multiple, independent conditions.7If more complex arrangements of assertions are needed, (s and & should be used.3+Asserts that the specified condition holds.4QSignals an assertion failure if a non-empty message (i.e., a message other than "" ) is passed.5:Asserts that the condition obtained from the specified , holds.6zAsserts that the specified actual value is equal to the expected value (with the expected value on the left-hand side).7xAsserts that the specified actual value is equal to the expected value (with the actual value on the left-hand side).8ZCreates a test case resulting from asserting the condition obtained from the specified ,.9“Shorthand for a test case that asserts equality (with the expected value on the left-hand side, and the actual value on the right-hand side).:“Shorthand for a test case that asserts equality (with the actual 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 Testable6, 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.>9Performs a test run with the specified report generators.QThis handles the actual running of the tests. Most developers will want to use HUnit.Text.runTestTTÍ instead. A developer could use this function to execute tests via another IO system, such as a GUI, or to output the results in a different manner (e.g., upload XML-formatted results to a webservice).ÿ†Note that the counts in a start report do not include the test case being started, whereas the counts in a problem report do include the test case just finished. The principle is that the counts are sampled only between test case executions. As a result, the number of test case successes always equals the difference of test cases tried and the sum of test case errors and failures.4 !"#$%&'()*+,-./01234The message that is displayed if the assertion fails The condition48The message that is displayed with the assertion failure55A value of which the asserted condition is predicated2A message that is displayed if the assertion fails6The expected valueThe actual value7The actual valueThe expected value85A value of which the asserted condition is predicated+A message that is displayed on test failure9The expected valueThe actual value:The actual valueThe expected value;<=>'report generator for the test run start/report generator for errors during the test run;report generator for assertion failures during the test runthe test to be executed?@ABCDEFGHI,  !"#$%&'()*+,-./0123456789:;<=>,()*+9:;8 3 4 67512/0.,-&' !"#$%<=># !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI5161718191:1;0SafeS+As the general text-based test controller (W–) executes a test, it reports each test case start, error, and failure by constructing a string and passing it to the function embodied in a Sg. A report string is known as a "line", although it includes no line terminator; the function in a S¡ is responsible for terminating lines appropriately. Besides the line, the function receives a flag indicating the intended "persistence" of the line: jH indicates that the line should be part of the final overall report; kß indicates that the line merely indicates progress of the test execution. Each progress line shows the current values of the cumulative test execution counts; a final, persistent line shows the final count values.The SK function is also passed, and returns, an arbitrary state value (called st4 here). The initial state value is given in the S!; the final value is returned by W.U)Two reporting schemes are defined here. putTextToHandle* writes report lines to a given handle. V8 accumulates persistent lines for return as a whole by W.putTextToHandlez writes persistent lines to the given handle, 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 overwritten by the next report line. As overwriting involves writing carriage return and blank characters, its proper effect is usually only obtained on terminal devices.VGAccumulates persistent lines (dropping progess lines) for return by W1. The accumulated lines are represented by a l (m -> m)_ function whose first argument is the string to be appended to the accumulated report lines.WîExecutes 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's function and finally returned, along with final count values.X+Converts test execution counts to a string.Y…Converts a test case path to a string, separating adjacent elements by the colon (':'). An element of the path is quoted (as with n') when there is potential ambiguity.Z¿Provides the "standard" text-based test controller. Reporting is made to standard error, and progress reports are included. For possible programmatic use, the final counts are returned.EThe "TT" in the name suggests "Text-based reporting to the Terminal". STUWrite progress lines to handle?VWoXYZSTUVWXYZSTUVWYXZSTUVWoXYZSafe4  !"#$%&'()*+,-./0123456789:;<=>STUVWXYZp      !""#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWWXYZ[\]^_`abcdefghijklmnomnpqrsqtuqrvwx$HUnit-1.5.0.0-LmQy44w6E24IQ5C7bKO5PwTest.HUnit.TerminalTest.HUnit.LangTest.HUnit.BaseTest.HUnit.Text Paths_HUnit Test.HUnitterminalAppearanceResultSuccessFailureError FailureReasonReasonExpectedButGot HUnitFailure Assertion assertFailure assertEqualformatFailureReasonperformTestCase$fExceptionHUnitFailure$fEqFailureReason$fShowFailureReason$fEqHUnitFailure$fShowHUnitFailure $fEqResult $fShowResultNodeListItemLabelPath ReportProblem ReportStartStatepathcountsCountscasestriederrorsfailuresTestabletestTestTestCaseTestList TestLabelAssertionPredicableassertionPredicateAssertionPredicateListAssertable listAssert Assertableassert assertBool assertString@?@=?@?=~?~=?~?=~: testCasePaths testCaseCount performTest $fTestable[] $fTestableIO$fTestableTest $fShowTest$fAssertionPredicableIO$fAssertionPredicableBool$fListAssertableChar$fAssertableIO$fAssertable[]$fAssertableBool$fAssertable() $fEqCounts $fShowCounts $fReadCounts$fEqNode $fShowNode $fReadNode $fEqState $fShowState $fReadStatePutTextputTextToHandleputTextToShowS runTestText showCountsshowPath runTestTTcatchIOversionbindirlibdirdatadir libexecdir sysconfdir getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNametalocationghc-prim GHC.TypesTrueFalsebaseGHC.ShowShowSGHC.BaseStringshowformatLocation