h&<:A      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg  Safe-InferredhijklmnoOption spec for TLT(c) John Maraist, 2022GPL3haskell-tlt@maraist.org experimentalPOSIX Safe-Inferred_TLTRecord of options which may be specified for running and reporting TLT tests.TLTDefault initial options.TLT*Update the display of showing passes in a  record.TLT*Update the display of showing passes in a  record.Results representation for TLT(c) John Maraist, 2022GPL3haskell-tlt@maraist.org experimentalPOSIX Safe-Inferred TLTHierarchical structure holding the result of running tests, possibly grouped into tests. TLTThe ps are respectively the total number of tests executed, and total number of failures detected. TLTReasons why a test might fail. TLTA failure arising from an    which is not met. TLTA failure associated with a call to a Haskell function triggering an error. TLTDefault conversion of a   to a descriptive string.TLT0Return the number of failed tests reported in a .TLT*Return the number of tests described by a .TLT:Return the number of failed tests described in a list of s.TLT2Return the number of tests described in a list of s.     $Testing in a monad transformer layer(c) John Maraist, 2022GPL3haskell-tlt@maraist.org experimentalPOSIX Safe-Inferred sTLTAccumulator for test results, in the style of a simplified Huet's zipper which only ever adds to the end of the structure.TLTAdd a single test result to a .TLT)Convert the topmost group of a bottom-up 3 into a completed top-down report about the group.TLT Derive a new  corresponding to finishing the current group and continuing to accumulate results into its enclosure.TLT Convert a  into a list of top-down s.$Testing in a monad transformer layer(c) John Maraist, 2022GPL3haskell-tlt@maraist.org experimentalPOSIX Safe-Inferred/TLTEnabling TLT checking of the completion of computations with- or without uncaught exceptions in a (possibly embedded) q or r monad.:In general, it is more difficult to automatically deduce MonadTLTExcept instances than MonadTLT because  instances bodies will frequently require additional parameters to functions such as s, or values corresponding to t., which are specific to a particular scenario.Note that using MonadTLTExcept# imposes the restriction that the . transformer layer must be wrapped within the q transformer layer.TLT Extending  operations across other monad transformers. For easiest and most flexible testing, declare the monad transformers of your application as instances of this class.TLTLift TLT operations within a monad transformer stack. Note that with enough transformer types included in this class, the liftTLT function should usually be unnecessary: the commands in this module which actually configure testing, or specify a test, already liftTLT their own result. So they will all act as top-level transformers in MonadTLT.TLTMonad transformer for TLT tests. This layer stores the results from tests as they are executed.!TLT Synonym for the elements of the  state."TLT!Execute the tests specified in a  monad without output side-effects, returning the final options and result reports.This function is primarily useful when calling TLT from some other package. If you are using TLT itself as your test framework, and wishing to see its human-oriented output directly, consider using   instead.#TLTThis function controls whether   will report only tests which fail, suppressing any display of tests which pass, or else report the results of all tests. The default is the former: the idea is that no news should be good news, with the programmer bothered only with problems which need fixing.$TLT(This function controls whether the main   executable should exit after displaying test results which include at least one failing test. By default, it will exit in this situation. The idea is that a test suite can be broken into parts when it makes sense to run the latter parts only when the former parts all pass.%TLTReport a failure. Useful in pattern-matching cases which are entirely not expected.&TLT+Report a success. Useful in default cases.'TLTOrganize the tests in the given subcomputation as a separate group within the test results we will report.(TLTEnsure that a computation in q* completes without an uncaught exception.)TLTEnsure that a computation in q does throw an uncaught exception, allowing further testing of the exception.*TLTEnsure that a computation in q# does throw an uncaught exception.7TLTThe 3 function in this case simply discards any output.8TLTThe 3 function in this case simply discards any output. !"#$%&'()*! "#$%&'()*$Testing in a monad transformer layer(c) John Maraist, 2022GPL3haskell-tlt@maraist.org experimentalPOSIX Safe-Inferred  ?TLT!Execute the tests specified in a / monad, and report the results as text output.When using TLT from some other package (as opposed to using TLT itself as your test framework, and wishing to see its human-oriented output directly), consider using " instead.@TLTReport the results of tests.ATLT2Command to set an ANSI terminal to boldface black.BTLT0Command to set an ANSI terminal to boldface red.CTLT2Command to set an ANSI terminal to boldface green.DTLT5Command to set an ANSI terminal to medium-weight red.ETLT7Command to set an ANSI terminal to medium-weight green.FTLT6Command to set an ANSI terminal to medium-weight blue.GTLT7Command to set an ANSI terminal to medium-weight black.HTLTCommand to set an ANSI terminal to the standard TLT weight and color for a passing test.ITLTCommand to set an ANSI terminal to the standard TLT weight and color for a failing test. ?@ABCDEFGHI ?@ABCDEFGHI(Assertions and related utilities for TLT(c) John Maraist, 2022GPL3haskell-tlt@maraist.org experimentalPOSIX Safe-Inferred) JTLTAn assertion is a computation (typically in the monad wrapped by ) which returns a list of zero of more reasons for the failure of the assertion. A successful computation returns an empty list: no reasons for failure, hence success.KTLT3This assertion always fails with the given message.LTLTThis assertion always succeeds.MTLTLabel and perform a test of an J.Example test :: Monad m => TLT m () test = do "2 is 2 as result" ~: 2 @== return 2 -- This test passes. "2 not 3" ~: 2 @/=- 3 -- This test fails.NTLT3Label and perform a test of a (pure) boolean value.Example test :: Monad m => TLT m () test = do "True passes" ~::- return True -- This test passes. "2 is 2 as single Bool" ~::- return (2 == 2) -- This test passes. "2 is 3!?" ~::- myFn 4 "Hammer" -- Passes if myFn (which -- must be monadic) -- returns True.OTLTLabel and perform a test of a boolean value returned by a computation in the wrapped monad m.Example test :: Monad m => TLT m () test = do "True passes" ~::- True -- This test passes. "2 is 2 as single Bool" ~::- 2 == 2 -- This test passes. "2 is 3!?" ~::- 2 == 2 -- This test fails.PTLTTransform a binary function on an expected and an actual value (plus a binary generator of a failure message) into an J for a pure given actual value.Example$TLT's scalar-testing operators like @==-! are defined with this function: (@==-) :: (Monad m, Eq a, Show a) => a -> a -> Assertion m (@==-) = liftAssertion2Pure (==) $ \ exp actual -> "Expected " ++ show exp ++ " but got " ++ show actualThe u operator tests equality, and the result here allows the assertion that a value should be exactly equal to a target. The second argument formats the detail reported when the assertion fails.QTLT Given an J; for two pure values (expected and actual), lift it to an J? expecting the actual value to be returned from a computation.ExamplesThe TLT assertion `Test.TLT.(==)` lifts `Test.TLT.(==-)` (both defined in   ) from expecting a pure actual result to expecting a computation returning a value to test. (@==) :: (Monad m, Eq a, Show a) => a -> m a -> Assertion m (@==) = assertion2PtoM (@==-)RTLTTransform a binary function on expected and actual values (plus a generator of a failure message) into an J where the actual value is to be returned from a subcomputation.STLTTransform a unary function on a value (plus a generator of a failure message) into a unary function returning an J for a pure given actual value.ExampleThe TLT assertion   (defined in   ) is built from the v predicate w emptyP :: (Monad m, Traversable t) => t a -> Assertion m emptyP = liftAssertionPure null (\ _ -> "Expected empty structure but got non-empty")TTLT Given an J+ for a pure (actual) value, lift it to an J7 expecting the value to be returned from a computation.ExampleThe TLT assertion   (defined in   ) on monadic computations returning lists is defined in terms of the corresponging assertion on pure list-valued expressions. empty :: (Monad m, Traversable t) => m (t a) -> Assertion m empty = assertionPtoM emptyPUTLTTransform a unary function on an actual value (plus a generator of a failure message) into an J: where the value is to be returned from a subcomputation. JKLMNOPQRSTU JKLMNOPQRSTUM0N0O0 Standard test operations for TLT(c) John Maraist, 2022GPL3haskell-tlt@maraist.org experimentalPOSIX Safe-Inferred8VTLTAssert that two values are equal. This assertion takes an expected and an actual value; see W to compare the result of a monadic computation to an expected value.Examples test :: Monad m => TLT m () test = do "Make sure that 2 is still equal to itself" ~: 2 @==- 2 "Make sure that there are four lights" ~: 4 @==- length lightsWTLTAssert that a calculated value is as expected. This assertion compare the result of a monadic computation to an expected value; see V to compare an  actual value to the expected value.Examples test :: Monad m => TLT m () test = do "Make sure that 2 is still equal to itself" ~: 2 @== return 2 "Make sure that there are four lights" ~: 4 @== countLights -- where countLights :: m IntXTLTAssert that two values are not equal. This assertion takes an expected and an actual value; see Y to compare the result of a monadic computation to an expected value.YTLTAssert that a calculated value differs from some known value. This assertion compares the result of a monadic computation to an expected value; see X to compare an  actual value to the expected value.ZTLTAssert that a given boundary is strictly less than some value. This assertion takes an expected and an actual value; see [ to compare the result of a monadic computation to an expected value.[TLTAssert that a given, constant boundary is strictly less than some calculated value. This assertion compares the result of a /monadic computation/ to an expected value; see Z to compare an  actual value to the expected value.\TLTAssert that a given boundary is strictly less than some value. This assertion takes an expected and an actual value; see ] to compare the result of a monadic computation to an expected value.]TLTAssert that a given, constant boundary is strictly less than some calculated value. This assertion compares the result of a /monadic computation/ to an expected value; see \ to compare an  actual value to the expected value.^TLTAssert that a given boundary is strictly less than some value. This assertion takes an expected and an actual value; see _ to compare the result of a monadic computation to an expected value._TLTAssert that a given, constant boundary is strictly less than some calculated value. This assertion compares the result of a /monadic computation/ to an expected value; see ^ to compare an  actual value to the expected value.`TLTAssert that a given boundary is strictly less than some value. This assertion takes an expected and an actual value; see a to compare the result of a monadic computation to an expected value.aTLTAssert that a given, constant boundary is strictly less than some calculated value. This assertion compares the result of a /monadic computation/ to an expected value; see ` to compare an  actual value to the expected value.bTLTAssert that a pure traversable structure (such as a list) is empty.cTLTAssert that a traversable structure (such as a list) returned from a computation is empty.dTLTAssert that a pure traversable structure (such as a list) is nonempty.eTLTAssert that a traversable structure (such as a list) returned from a computation is non-empty.fTLTAssert that a x value is t.gTLTAssert that a x result of a computation is t.VWXYZ[\]^_`abcdefgVWXYZ[\]^_`abcdefg V1W1X1Y1Z1[1\1]1^1_1`1a1 $Testing in a monad transformer layer(c) John Maraist, 2022GPL3haskell-tlt@maraist.org experimentalPOSIX Safe-Inferred9,#$%'()*?JKLMNOPQRSTUVWXYZ[\]^_`abcdefg,?#$MON%'JVXZ\^`WY[]_acebdgfKLSTUPQR(*) !"#$%&'()*+,,-./0123456789:;<=>?@ABCDEFGHIJK LMNOPQRSTU VWXYZ[\]^_`abcdefghijkl mnopqrstuvwxyz{|}~|}|y"TLT-0.4.0.0-1TT24lm79G28ijiVi3ko3UTest.TLT.OptionsTest.TLT.ResultsTest.TLT.BufferTest.TLT.ClassTest.TLT.ReportTest.TLT.AssertionTest.TLT.Standard Paths_TLTTest.TLT AssertiontltStandardemptyPemptyTLTopts optShowPassesoptQuitAfterFailReport defaultOptswithShowPasseswithExitAfterFail TestResultTestGroupTestFailAssertedErred formatFail failCount testCounttotalFailCounttotalTestCountTRBufBufTop addResult currentGrouppopGroup closeTRBufMonadTLTExcept liftTLTExcept runToExceptMonadTLTliftTLTTLTunwrapTLTstaterunTLTreportAllTestResultssetExitAfterFailDisplaytltFailtltPassinGroup noUncaught uncaughtWithuncaught$fMonadTLTWriterTn$fMonadTLTWriterTn0$fMonadTLTSTTn$fMonadTLTStateTn$fMonadTLTExceptTn$fMonadTLTStateTn0$fMonadTLTResourceTn$fMonadTLTReaderTn$fMonadTLTMaybeTn$fMonadTLTIdentityTn$fMonadTLTFreeTn$fMonadTLTTLTm$fMonadTLTExceptWriterTentne$fMonadTLTExceptWriterTentne0$fMonadTLTExceptIdentityTentne$fMonadTLTExceptExceptTentm $fFunctorTLT$fApplicativeTLT $fMonadTLT$fMonadTransTLTreport boldBlackboldRed boldGreen mediumRed mediumGreen mediumBlue mediumBlack greenPassredFail assertFailed assertSuccess~:~::-~::liftAssertion2Pureassertion2PtoMliftAssertion2MliftAssertionPure assertionPtoMliftAssertionM@==-@==@/=-@/=@<-@<@>-@>@<=-@<=@>=-@>= nonemptyPnonemptynothingPnothingversiongetDataFileName getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirghc-prim GHC.TypesInttransformers-0.5.6.2Control.Monad.Trans.ExceptExceptTExceptControl.Monad.Trans.Reader runReaderTbase GHC.MaybeNothing GHC.Classes==Data.Traversable Traversable Data.FoldablenullMaybe