8p      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnoSafepCatch possible exceptions that may arise when evaluating a string. For normal (total) strings, this is a no-op.qThis function should be used to display messages generated by the test suite (such as test result descriptions). See e.g. ,https://github.com/feuerbach/tasty/issues/25NoneIMonoid generated by p (q)Monoid generated by rstst None0uBTake a list of actions and execute them in parallel, no more than n at the same time.The action itself is asynchronous, ie. it returns immediately and does the work in new threads. It returns an action which aborts tests and cleans up. vwxyzu"maximum number of parallel threadslist of actions to execute{|}~u vwxyzu{|}~Safe %&09;AQRTaThe purpose of this data type is to capture the dictionary corresponding to a particular option. ;A set of options. Only one option of each type can be kept.FIf some option has not been explicitly set, the default value is used. +An option is a data type that inhabits the   type class. :The value to use if the option was not supplied explicitly *Try to parse an option value from a string The option name. It is used to form the command line option name, for instance. Therefore, it had better not contain spaces or other fancy characters. It is recommended to use dashes instead of spaces.HThe option description or help string. This can be an arbitrary string.A command-line option parser.It has a default implementation in terms of the other methods. You may want to override it in some cases (e.g. add a short flag) and ,  and  might come in handy.nEven if you override this, you still should implement all the methods above, to allow alternative interfaces.!Do not supply a default value here for this parser! This is because if no value was provided on the command line we may lookup the option e.g. in the environment. But if the parser always succeeds, we have no way to tell whether the user really provided the option on the command line.Set the option valueQuery the option valueChange the option valueCreate a singleton  %Command-line parser to use with flags@Command-line flag parser that takes additional option modifiers.BCommand-line option parser that takes additional option modifiers.=Safe read function. Defined here for convenience to use for  .#Later options override earlier ones optional short flag-non-default value (when the flag is supplied)option modifier-non-default value (when the flag is supplied)        None0<A pattern to filter tests. For the syntax description, see 4http://documentup.com/feuerbach/tasty#using-patterns A pattern that matches anything.Parse a patternkTest a path (which is the sequence of group titles, possibly followed by the test title) against a pattern  None0I)Timeout to be applied to individual tests9 is the original representation of the timeout (such as "0.5m"!), so that we can print it back.  is the number of microseconds. 4Number of parallel threads to use for running tests.Note that this is not included in $@. Instead, it's automatically included in the options for any  TestReporter ingredient by ingredientOptions, because the way test reporters are handled already involves parallelism. Other ingredients may also choose to include this option.<Filtering function to prevent non-positive number of threads#A shortcut for creating  values$The list of all core options, i.e. the options not specific to any provider or ingredient, but to tasty itself. Currently contains  and .  !"# microseconds$ !"#$ !"#$ None05:AIOT#%An algebra for folding a *.2Instead of constructing fresh records, build upon JP instead. This way your code won't break when new nodes/fields are indroduced.*.The main data structure defining a test suite.qIt consists of individual test cases and properties, organized in named groups which form a tree-like hierarchy.There is no generic way to create a test case. Instead, every test provider (tasty-hunit, tasty-smallcheck etc.) provides a function to turn a test case into a *.Groups can be created using I.+%A single test of some particular type,0Assemble a number of tests into a cohesive group-Add some options to child tests.rAcquire the resource before the tests in the inner tree start and release it after they finish. The tree gets an Z action which yields the resource, although the resource is shared across all the tests./9Ask for the options and customize the tests based on themA resources-related exception00a describes how to acquire a resource (the first field) and how to release it (the second field).2&The name of a test or a group of tests33The interface to be implemented by a test provider. The type tK is the concrete representation of the test which is used by the provider.4 Run the testeThis method should cleanly catch any exceptions in the code to test, and return them as part of the :, see D# for an explanation. It is ok for 4 to raise an exception if there is a problem with the test suite code itself (for example, if a file that should contain example data or expected output is not found).5?The list of options that affect execution of tests of this type6Test progress information.jThis may be used by a runner to provide some feedback to the user while a long-running test is executing.8-textual information about the test's progress99W should be a value between 0 and 1. If it's impossible to compute the estimate, use 0.: A test result<Did the test fail? If so, why?== may contain some details about the test. For a passed test it's ok to leave it empty. Providers like SmallCheck and QuickCheck use it to provide information about how many tests were generated.For a failed test, => should typically provide more information about the failure.>?The short description printed in the test run summary, usually OK or FAIL.?-How long it took to run the test, in seconds.@@Time in seconds. Used to measure how long the tests took to run.AOutcome of a test runNote: this is isomorphic to  D. You can use the  generic-maybe package to exploit that.Btest succeededCtest failed because of the DDIf a test failed, D describes whyEtest provider indicated failure of the code to test, either because the tested code returned wrong results, or raised an exceptionFgthe test code itself raised an exception. Typical cases include missing example input or output files.;Usually, providers do not have to implement this, as their 4' method may simply raise an exception.G%test didn't complete in allotted timeH for a passed test,  for a failed one.Shortcut for creating a : that indicates exceptionI2Create a named group of test cases or other groupsJJM can serve as the basis for custom folds. Just override the fields you need.Here's what it does:single tests are mapped to ( (you probably do want to override that)#test groups are returned unmodifiedfor a resource, an IO action that throws an exception is passed (you want to override this for runners/ingredients that execute tests)K%Fold a test tree into a single value.The fold result type should be a monoid. This is used to fold multiple results in a test group. In particular, empty groups get folded into .RApart from pure convenience, this function also does the following useful things: ?Keeping track of the current options (which may change due to - nodes)7Filtering out the tests which do not match the patternsEThus, it is preferred to an explicit recursive traversal of the tree.Note: right now, the patterns are looked up only once, and won't be affected by the subsequent option changes. This shouldn't be a problem in practice; OTOH, this behaviour may be changed later.?Get the list of options that are relevant for a given test tree/%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK%the algebra (i.e. how to fold a tree)initial optionsthe tree to fold-%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKNoneL Convert a test to a leaf of the *M: of a passed testN: of a failed testLMdescription (may be empty)N description *23456789:LMN 345MN:67892*LLMN None:AOT OFMapping from test numbers (starting from 0) to their status variables.bThis is what an ingredient uses to analyse and display progress, and to detect when tests finish.PCurrent status of a testQ test has not started running yetRtest is being runS!test finished with a given result'Execute a test taking care of resourcesZTurn a test tree into a list of actions to run tests coupled with variables to watch themCUsed to create the IO action which is passed in a WithResource nodeTStart running all the tests in a test tree in parallel, without blocking the current thread. The number of test running threads is determined by the   option.Measure the time taken by an  action to runGet monotonic timeWarning: This is not the system time, but a monotonically increasing time that facilitates reliable measurement of time differences.OPQRSOthe action to execute the test, which takes a progress callback as a parametervariable to write status tooptional timeout to apply+initializers (to be executed in this order))finalizers (to be executed in this order)T#A callback. First, it receives the O through which it can observe the execution of tests in real time. Typically (but not necessarily), it waits until all the tests are finished.After this callback returns, the test-running threads (if any) are terminated and all resources acquired by tests are released.3The callback must return another callback (of type @ ->  a) which additionally can report and/or record the total time taken by the test suite. This time includes the time taken to run all resource initializers and finalizers, which is why it is more accurate than what could be measured from inside the first callback.OPSQRTOPQRSTNoneUUs make your test suite tasty.Ingredients represent different actions that you can perform on your test suite. One obvious ingredient that you want to include is one that runs tests and reports the progress and results.NAnother standard ingredient is one that simply prints the names of all tests.Similar to test providers (see 3), every ingredient may specify which options it cares about, so that those options are presented to the user if the ingredient is included in the test suite.1An ingredient can choose, typically based on the  #, whether to run. That's what the  is for. The first ingredient that agreed to run does its work, and the remaining ingredients are ignored. Thus, the order in which you arrange the ingredients may matter.Usually, the ingredient which runs the tests is unconditional and thus should be placed last in the list. Other ingredients usually run only if explicitly requested via an option. Their relative order thus doesn't matter.qThat's all you need to know from an (advanced) user perspective. Read on if you want to create a new ingredient.#There are two kinds of ingredients.The first kind is V-. If the ingredient that agrees to run is a V=, then tasty will automatically launch the tests and pass a O to the ingredient. All the ingredient needs to do then is to process the test results and probably report them to the user in some way (hence the name).W is the second kind of ingredient. It is typically used for test management purposes (such as listing the test names), although it can also be used for running tests (but, unlike Vh, it has to launch the tests manually if it wants them to be run). It is therefore more general than V. V# is provided just for convenience.CThe function's result should indicate whether all the tests passed.In the W case, it's up to the ingredient author to decide what the result should be. When no tests are run, the result should probably be N. Sometimes, even if some tests run and fail, it still makes sense to return .VJFor the explanation on how the callback works, see the documentation for T.Try to run an U.7If the ingredient refuses to run (usually based on the  ), the function returns .For a VJ, this function automatically starts running the tests in the background.XRun the first U that agrees to be run.#If no one accepts the task, return .. This is usually a sign of misconfiguration.Y?Return the options which are relevant for the given ingredient.=Note that this isn't the same as simply pattern-matching on U. E.g. options for a V automatically include  .ZLike ingredientOption&, but folds over multiple ingredients.[All the options relevant for this test suite. This includes the options for the test tree and ingredients, and the core options.\ Compose two V ingredients which are then executed in parallel. This can be useful if you want to have two reporters active at the same time, e.g., one which prints to the console and one which writes the test results to a file.(Be aware that it is not possible to use \ with a W, it only works for V ingredients. UVWXYZ[\UVWXYZ[\UVWXYZ[\UVWXYZ[\None]OThis ingredient doesn't do anything apart from registering additional options.(The option values can be accessed using  askOption.]]]None0I^This option, when set to 8, specifies that we should run in the list tests mode`)Obtain the list of all tests in the suitea;The ingredient that provides the test listing functionality^_`a^_`a^_`aNone0T(Search the environment for given options>Search the environment for all options relevant for this suiteNone0:<=When to use color on the outputbReport only failed testsd2Do not print test results (see README for details) is an intermediary between output formatting and output printing. It lets us have several different printing modes (normal; print failures only; quiet).fA simple console UIuseColor when isTerm, decides if colors should be used, where isTerm denotes where stdout is a terminal device.,Compute the amount of space needed to align OKs and FAILsControl color output5bcdefbcdef$bcdefNone ]^_`abcdef fdebca^_`]NoneTgAGenerate a command line parser from a list of option descriptionsh*The command line parser for the test suiteiWParse the command line arguments and run the tests using the provided ingredient list.+When the tests finish, this function calls G with the exit code that indicates whether any tests have failed. See  defaultMain for details.ghi[ghighiNoneF !"$%&'()*+,-./016789:;<=>?@ABCDEFGHJKOPSQRTUVWXYZ[^_`afghiF*+,-./K%&'()J01UVW@XYZfa^_`ghiPQRS:;<=>?ABCDEFGH6789OT !"[$Nonej.List of the default ingredients. This is what k uses.At the moment it consists of a and f.k3Parse the command line arguments and run the tests.+When the tests finish, this function calls exitWith with the exit code that indicates whether any tests have failed. Most external systems (stack, cabal, travis-ci, jenkins etc.) rely on the exit code to detect whether the tests pass. If you want to do something else after kI returns, you need to catch the exception and then re-throw it. Example: import Test.Tasty import Test.Tasty.HUnit import System.Exit import Control.Exception test = testCase "Test 1" (2 @?= 3) main = defaultMain test `catch` (\e -> do if e == ExitSuccess then putStrLn "Yea" else putStrLn "Nay" throwIO e)l:Locally adjust the option value for the given test subtreem7Locally set the option value for the given test subtreen5Customize the test tree based on the run-time optionsoJAcquire the resource to run this test (sub)tree and release it afterwardsjklmnoinitialize the resourcefree the resource aH is an action which returns the acquired resource. Despite it being an i action, the resource it returns will be acquired only once and shared across all the tests in the tree.#*2I]ijklmno2*Ikij]lmn#ojklmno !"#$%&'() * + , - . . / 0 0 1 2 3 4 4 5 6 7 8 9 : ; < = > > ? @ A B C C D E F F G H I J K L M N O P Q R S T U VWXY Z [ \ ] ^ _`abcdefghiijkllmmnopqrstuvwxyzx{|xy}~      *          xy  xy xy                 xyx#tasty-0.11.2-EmsdDRLc32M3fJaXAAAe2uTest.Tasty.RunnersTest.Tasty.Options Test.TastyTest.Tasty.ProvidersTest.Tasty.IngredientsTest.Tasty.Ingredients.BasicTest.Tasty.Runners.UtilsTest.Tasty.Runners.ReducersTest.Tasty.ParallelTest.Tasty.PatternsTest.Tasty.Options.CoreTest.Tasty.CoreTest.Tasty.Run'Test.Tasty.Ingredients.IncludingOptions Test.Tasty.Ingredients.ListTestsTest.Tasty.Options.Env&Test.Tasty.Ingredients.ConsoleReporterTest.Tasty.CmdLine formatMessageApgetApp Traversal getTraversalOptionDescriptionOption OptionSetIsOption defaultValue parseValue optionName optionHelpoptionCLParser setOption lookupOption changeOption singleOption flagCLParsermkFlagCLParsermkOptionCLParsersafeRead$fMonoidOptionSet TestPattern noPatternparseTestPatterntestPatternMatchesTimeout NoTimeout NumThreads getNumThreads mkTimeout coreOptionsTreeFold foldSingle foldGroup foldResourceTestTree SingleTest TestGroupPlusTestOptions WithResource AskOptions ResourceSpecTestNameIsTestrun testOptionsProgress progressTextprogressPercentResult resultOutcomeresultDescriptionresultShortDescription resultTimeTimeOutcomeSuccessFailure FailureReason TestFailedTestThrewException TestTimedOutresultSuccessful testGroup trivialFold foldTestTree singleTest testPassed testFailed StatusMapStatus NotStarted ExecutingDonelaunchTestTree Ingredient TestReporter TestManagertryIngredientsingredientOptionsingredientsOptions suiteOptionscomposeReportersincludingOptions ListTests testsNames listingTests HideSuccessesQuietconsoleTestReporter optionParsersuiteOptionParserdefaultMainWithIngredientsdefaultIngredients defaultMain adjustOption localOption askOption withResourcebaseGHC.BaseliftA2 Data.Monoid<>*> $fMonoidAp$fMonoidTraversal runInParallelParThreadKilled Interruptshutdown myForkFinally$fExceptionParThreadKilled$fShowParThreadKilled$fExceptionInterrupt$fShowInterrupt OptionValue NoPatterntp_categories_only tp_negated tp_match_mode tp_tokensTestPatternMatchMode TestMatchMode PathMatchModeToken SlashToken WildcardTokenDoubleWildcardToken LiteralTokentokenizebuildTokenRegexregexEscapeChar pathToStringdropLast$fIsOptionTestPattern$fReadTestPatternString integer-gmpGHC.Integer.TypeInteger onlyPositive parseTimeout$fIsOptionTimeout$fIsOptionNumThreadsghc-prim GHC.TypesIO ResourceErrorMaybeTrueFalseexceptionResultmempty treeOptionsNotRunningTestsUnexpectedStateUseOutsideOfTest$fExceptionResourceError$fShowResourceError executeTestcreateTestActions getResourcetimedgetTime InitFinPair Finalizer Initializer ResourceVarResource NotCreated BeingCreatedFailedToCreateCreated DestroyedunexpectedState$fShowResource tryIngredientNothing$fIsOptionListTests getEnvOptionssuiteEnvOptionsEnvOptionException BadOption myLookupEnv$fExceptionEnvOptionException$fShowEnvOptionExceptionUseColor TestOutputuseColorcomputeAlignment$fIsOptionUseColorMaximum MinusInfinityNeverAlwaysAuto FailureStatusUnknownFailedOK Statistics statTotal statFailuresLevel PrintTest PrintHeadingSkipSeq produceOutputfoldTestOutput consoleOutputconsoleOutputHidingSuccessesstreamOutputHidingSuccessescomputeStatisticsprintStatistics failureStatus parseUseColorgetResultFromTVar indentSizeindent formatDescfailokinfoOkinfoFailoutput$fMonoidMaximum$fIsOptionHideSuccesses$fIsOptionQuiet$fMonoidFailureStatus$fMonoidStatistics$fMonoidTestOutput System.ExitexitWith