śĪ{kæ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š ‹ Œ  Ž ‘’“ ” • – — ˜ ™ š › œ  ž Ÿ   ” ¢ £ ¤ „ ¦ § Ø © Ŗ « ¬ ­ ® Æ ° ± ² ³ “ µ ¶ · ø ¹ŗ»¼½¾Safe &'1;=CSTV&FaThe 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 value Query the option value Change the option value Create 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)   æĄĮ None1,"ĀBTake 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.Ā"maximum number of parallel threadslist of actions to executeĀĆÄÅĘ p© 2015 2018 Megaparsec contributors © 2007 Paolo Martini © 1999 2001 Daan LeijenSafe_oĒ?This data type specifies operators that work on values of type az. An operator is either binary infix or unary prefix or postfix. A binary operator has also an associated associativity.ČNon-associative infixÉLeft-associative infixŹRight-associative infixĖPrefixĢPostfixĶ9Right-associative ternary. Right-associative means that a ? b : d ? e : f parsed as a ? b : (d ? e : f) and not as (a ? b : d) ? e : f.ĪĪ term table( builds an expression parser for terms term with operators from table<, taking the associativity and precedence specified in the table into account.table is a list of [Operator m a]’ lists. The list is ordered in descending precedence. All operators in one list have the same precedence (but may have different associativity).TPrefix and postfix operators of the same precedence associate to the left (i.e. if ++ is postfix increment, than -2++ equals -1, not -3).AUnary operators of the same precedence can only occur once (i.e. --2 is not allowed if -i is prefix negate). If you need to parse several prefix or postfix operators in a row, (like C pointers **i) you can use this approach: /manyUnaryOp = foldr1 (.) <$> some singleUnaryOpsThis is not done by default because in some cases allowing repeating prefix or postfix operators is not desirable.If you want to have an operator that is a prefix of another operator in the table, use the following (or similar) wrapper instead of plain  : Aop n = (lexeme . try) (string n <* notFollowedBy punctuationChar)μ takes care of all the complexity involved in building an expression parser. Here is an example of an expression parser that handles prefix signs, postfix increment and basic arithmetic: ’¼expr = makeExprParser term table <?> "expression" term = parens expr <|> integer <?> "term" table = [ [ prefix "-" negate , prefix "+" id ] , [ postfix "++" (+1) ] , [ binary "*" (*) , binary "/" div ] , [ binary "+" (+) , binary "-" (-) ] ] binary name f = InfixL (f <$ symbol name) prefix name f = Prefix (f <$ symbol name) postfix name f = Postfix (f <$ symbol name)ĻaddPrecLevel p ops. adds the ability to parse operators in table ops to parser p.ŠpTerm prefix term postfix parses a termE surrounded by optional prefix and postfix unary operators. Parsers prefix and postfix$ are allowed to fail, in this case Ń is used.ŅpInfixN op p x' parses non-associative infix operator op, then term with parser p5, then returns result of the operator application on x and the term.ÓpInfixL op p x( parses left-associative infix operator op, then term with parser p5, then returns result of the operator application on x and the term.ŌpInfixR op p x) parses right-associative infix operator op, then term with parser p6, then returns result of the operator application on x and the term.Õ/Parse the first separator of a ternary operatorÖsA helper to separate various operators (binary, unary, and according to associativity) and return them in a tuple.Ī Term parserOperator table, see ĒResulting expression parserĒĖÉŹČĢĶĪĒČÉŹĖĢĶSafebšnumber of fields%_nth field of the path, where 1 is the outermost group name and 0 is the whole test name, using / as a separator(an ERE token by itself, like foo but not like $1 ~ foo-,+*)(&%$"! '# !"#$%&'()*+,- !"#$%&'()*+,-NoneKtJ ×'Whether a parser is unary or non-unary. This roughly corresponds to the  unary_expr and non_unary_expr7 non-terminals in the awk grammar. (Why roughly? See Ų.)3 A separate 38 data type ensures that we don't forget to skip spaces.4 Run a parserŁAn awk ERE token such as foo>. No special characters are recognized at the moment, except @ as an escape character for /@ and itself.ŚBuilt-in functionsŪAtomic expressionsÜGArguments to unary operators: atomic expressions and field expressionsŲArithmetic expressions.ˆUnlike awk, non-unary expressions disallow unary operators everywhere, not just in the leading position, to avoid extra complexity in Ī.For example, the expression 1 3 + -4is valid in awk because 3 + -40 is non-unary, but we disallow it here because Ī) does not allow us to distinguish it from 1 -4 + 3which is ambiguous.Ż1Expressions that may include string concatenationŽ3Everything with lower precedence than concatenation5The awk-like expression parser4 text to parse/01234534/0125×ßą/0123įSafe%QVx¤āThe ć is ä5 if the source of the string allows it to be numeric=Evaluate an awk expression>Run the å" monad with a given list of fields"The field list should not include $0 ; it's calculated automatically.ępatternstring<=>=><ēčāéNone1y@ABC@źNone1K…ŸD)Timeout to be applied to individual testsEė9 is the original representation of the timeout (such as "0.5m"!), so that we can print it back. ģ is the number of microseconds.G4Number of parallel threads to use for running tests.Note that this is not included in K@. 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 threadsJA shortcut for creating D valuesK…The list of all core options, i.e. the options not specific to any provider or ingredient, but to tasty itself. Currently contains @ and D.J microsecondsDEFGHIJKDEFGHINone16<CKQVĢd#LAn algebra for folding a Q.2Instead of constructing fresh records, build upon qP instead. This way your code won't break when new nodes/fields are indroduced.Q.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 Q.Groups can be created using p.R%A single test of some particular typeS0Assemble a number of tests into a cohesive groupTAdd some options to child testsUrAcquire 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.V9Ask for the options and customize the tests based on themļA resources-related exceptionWWa describes how to acquire a resource (the first field) and how to release it (the second field).Y&The name of a test or a group of testsZ3The interface to be implemented by a test provider. The type tK is the concrete representation of the test which is used by the provider.[ Run the testeThis method should cleanly catch any exceptions in the code to test, and return them as part of the a, see k# for an explanation. It is ok for [© 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).\?The list of options that affect execution of tests of this type]Test progress information.jThis may be used by a runner to provide some feedback to the user while a long-running test is executing._-textual information about the test's progress``W should be a value between 0 and 1. If it's impossible to compute the estimate, use 0.a A test resultcDid the test fail? If so, why?ddÅ 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, d> should typically provide more information about the failure.e?The short description printed in the test run summary, usually OK or FAIL.f-How long it took to run the test, in seconds.g@Time in seconds. Used to measure how long the tests took to run.hOutcome of a test runNote: this is isomorphic to š k. You can use the  generic-maybe package to exploit that.itest succeededjtest failed because of the kkIf a test failed, k describes whylƒtest provider indicated failure of the code to test, either because the tested code returned wrong results, or raised an exceptionmgthe 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 [' method may simply raise an exception.n%test didn't complete in allotted timeoä for a passed test, ń for a failed one.ņShortcut for creating a a that indicates exceptionp2Create a named group of test cases or other groupsqqM 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 unmodified‡for a resource, an IO action that throws an exception is passed (you want to override this for runners/ingredients that execute tests)r%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 T 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[optionsthe test to runša callback to report progress. Note: the callback is a no-op at the moment and there are no plans to use it; feel free to ignore this argument for now.r%the algebra (i.e. how to fold a tree)initial optionsthe tree to fold-LMPONQVUTSRļõö÷WXYZ\[]^`_abfedcghjiknmloņpqrō LMNOPQRSTUVļ÷öõWXZ[\]^_`abcdefhijklmnNoneĻŽs Convert a test to a leaf of the Qta of a passed testua of a failed testtdescription (may be empty)u description QYZ[\]^_`astu Z[\tua]^_`YQsNoneKŃcvMonoid generated by ų (ł)yMonoid generated by śvwxyz{vwxyz{None<CQVķ |FMapping 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.}Current status of a test~ test has not started running yettest is being run€!test finished with a given resultū'Execute a test taking care of resourcesüZTurn a test tree into a list of actions to run tests coupled with variables to watch themżCUsed to create the IO action which is passed in a WithResource node—Start 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 G option.žMeasure the time taken by an ī action to run’Get monotonic time…Warning: This is not the system time, but a monotonically increasing time that facilitates reliable measurement of time differences.ūOthe 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)#A callback. First, it receives the | 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 g -> ī 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.|}€~   }~€None¤‚‚s 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 Z ), 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 ƒ-. If the ingredient that agrees to run is a ƒ=, then tasty will automatically launch the tests and pass a |› 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).„µ 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 ƒh, it has to launch the tests manually if it wants them to be run). It is therefore more general than ƒ. ƒ# is provided just for convenience.CThe function's result should indicate whether all the tests passed.In the „„ 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 ä.ƒJFor the explanation on how the callback works, see the documentation for . Try to run an ‚.7If the ingredient refuses to run (usually based on the ), the function returns  .For a ƒJ, this function automatically starts running the tests in the background.…Run the first ‚ that agrees to be run.#If no one accepts the task, return  .. This is usually a sign of misconfiguration.†?Return the options which are relevant for the given ingredient.=Note that this isn't the same as simply pattern-matching on ‚. E.g. options for a ƒ automatically include G.‡Like 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 ƒŁ 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 „, it only works for ƒ ingredients.‚ƒ„…†‡ˆ‰‚ƒ„…†‡ˆ‰‚ƒ„None1K"6ŠThis option, when set to ä8, specifies that we should run in the «list tests» modeŒ)Obtain the list of all tests in the suite;The ingredient that provides the test listing functionalityŠ‹ŒŠ‹None$§ŽOThis ingredient doesn't do anything apart from registering additional options.(The option values can be accessed using  askOption.ŽNone1V&¬(Search the environment for given options>Search the environment for all options relevant for this suiteNone1V,vAGenerate a command line parser from a list of option descriptions*The command line parser for the test suite‘WParse 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.ˆ‘Safe1<’pCatch 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/25’ None1<>?S8“ When to use color on the output–3Only if stdout is an ANSI color supporting terminal—Report only failed tests™2Do not print test results (see README for details)› :Track the number of tests that were run and failures of a Q or sub-tree.uNumber of active tests (e.g., that match the pattern specified on the commandline), inactive tests are not counted.ž#Number of active tests that failed.Ÿ Ÿ› is an intermediary between output formatting and output printing. It lets us have several different printing modes (normal; print failures only; quiet). jName of a test, an action that prints the test name, and an action that renders the result of the action.”QName of a test group, an action that prints the heading of a test group and the Ÿ for that test group.¢5Inactive test (e.g. not matching the current pattern)£ Two sets of  TestOuput on the same level¤  Build the Ÿ for a Q and . The colors7 ImplicitParam controls whether the output is colored.„ Fold function for the Ÿ tree into a .¦ printStatisticsG reports test success/failure statistics and time it took to run. The g, results is intended to be filled in by the ƒ callback. The colors9 ImplicitParam controls whether coloured output is used.§ printStatisticsNoTime. reports test success/failure statistics The colors8 ImplicitParam controls whether coloured output is used. Wait until1all tests have finished successfully, and return ä, or)at least one test has failed, and return ńØA simple console UI© useColor when isTerm, decides if colors should be used, where isTerm indicates whether stdout is a terminal device.,Compute the amount of space needed to align OKs and FAILs°Control color output„Eliminator for test cases. The IO () prints the testname. The  IO Result3 blocks until the test is finished, returning it's a. The Result -> IO ()& function prints the formatted output. Eliminator for test groups. The IO ()$ prints the test group's name. The b) is the result of folding the test group.The  TestOutput being rendered.The  StatusMap received by the ƒ lookahead“”•–—˜™š›œžŸ£ ”¢¤„¦§Ø©ؙš—˜“”•–©›œž¦§Ÿ ”¢£¤„“”•–—˜™š›œžŸ ”¢£ NoneT† Š‹ŒŽ—˜™šØ ؙš—˜Š‹ŒŽNoneUF@ABCGHIKLMNOPQRSTUVWX]^_`abcdefghijklmnoqrvwxyz{|}€~‚ƒ„…†‡ˆŠ‹Œ‘’ØFQRSTUVrLMNOPqWXyz{vwx‚ƒ„g…†‡ØŠ‹Œ‘}~€abcdefhijklmno]^_`|GHIˆK@BAC’Nonek¹.List of the default ingredients. This is what ŗ uses.At the moment it consists of  and Ø.ŗ3Parse 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 ŗI 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)»:Locally adjust the option value for the given test subtree¼7Locally set the option value for the given test subtree½5Customize the test tree based on the run-time options¾JAcquire the resource to run this test (sub)tree and release it afterwards¾initialize 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.DEFJQYpŽ‘¹ŗ»¼½¾YQpŗ‘¹Ž»¼½DEFJ¾ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]]^__`abccdefghijklmmnopqrrstuuvwxyz{I|}~€‚ƒ„…†‡ˆˆ‰ŠŠ‹ŒŽ‘’“”•–—˜™šš›œžŸ ” ¢ £ ¤ „ ¦ ¦ § § Ø Ø © Ŗ « ¬ ­ ® Æ ° ± ² ³ “ µ ¶ · ø ¹ ŗ » ¼ ½ ¾ æ Ą Į Ā Ć ÄÅĘĒČÉŹĖĖ Ģ Ķ Ķ Ī Ī Ļ Š Ń Ņ Ó Ō Õ Ö × ŲŁŚŪ Ü Ż Ž ß ąįāćäåęēčįéLźėģķėģīļšńņóYŁŚōõö÷ųėģłśŁŚūėģüżŁŚž’ŁŚŁŁŚ       ŁŚŁŁŚ   ! ! "# tasty-1.0-DJ8HAZ7DuEMB8YtJvdaOyHTest.Tasty.OptionsTest.Tasty.Patterns.TypesTest.Tasty.Patterns.ParserTest.Tasty.Patterns.EvalTest.Tasty.Runners Test.TastyTest.Tasty.ProvidersTest.Tasty.IngredientsTest.Tasty.Ingredients.Basic&Test.Tasty.Ingredients.ConsoleReporterTest.Tasty.ParallelTest.Tasty.Patterns.ExprText.Megaparsec.Char.LexersymbolTest.Tasty.PatternsTest.Tasty.Options.CoreTest.Tasty.CoreTest.Tasty.Runners.ReducersTest.Tasty.Run Test.Tasty.Ingredients.ListTests'Test.Tasty.Ingredients.IncludingOptionsTest.Tasty.Options.EnvTest.Tasty.CmdLineTest.Tasty.Runners.UtilsOptionDescriptionOption OptionSetIsOption defaultValue parseValue optionName optionHelpoptionCLParser setOption lookupOption changeOption singleOption flagCLParsermkFlagCLParsermkOptionCLParsersafeRead$fSemigroupOptionSet$fMonoidOptionSetExprIntLitNFAddSubNegNotAndLTGTLEGEEQNEOrConcatMatchNoMatchField StringLitIfERE ToUpperFn ToLowerFnLengthFnMatchFnSubstrFn $fShowExpr ParseResultSuccessInvalid AmbiguousParser runParserexpr$fFunctorParser$fApplicativeParser$fAlternativeParser $fMonadParser$fMonadPlusParser$fShowParseResultasBeval withFields $fShowValue TestPattern noPatternparseTestPatterntestPatternMatchesTimeout NoTimeout NumThreads getNumThreads mkTimeout coreOptionsTreeFold foldSingle foldGroup foldResourceTestTree SingleTest TestGroupPlusTestOptions WithResource AskOptions ResourceSpecTestNameIsTestrun testOptionsProgress progressTextprogressPercentResult resultOutcomeresultDescriptionresultShortDescription resultTimeTimeOutcomeFailure FailureReason TestFailedTestThrewException TestTimedOutresultSuccessful testGroup trivialFold foldTestTree singleTest testPassed testFailedApgetApp Traversal getTraversal StatusMapStatus NotStarted ExecutingDonelaunchTestTree Ingredient TestReporter TestManagertryIngredientsingredientOptionsingredientsOptions suiteOptionscomposeReporters ListTests testsNames listingTestsincludingOptions optionParsersuiteOptionParserdefaultMainWithIngredients formatMessageUseColorNeverAlwaysAuto HideSuccessesQuiet Statistics statTotal statFailures TestOutput PrintTest PrintHeadingSkipSeqbuildTestOutputfoldTestOutputprintStatisticsprintStatisticsNoTimeconsoleTestReporteruseColor$fSemigroupTestOutput$fMonoidTestOutput$fSemigroupStatistics$fMonoidStatistics$fIsOptionQuiet$fIsOptionHideSuccesses$fIsOptionUseColor$fSemigroupMaximum$fMonoidMaximum $fEqQuiet $fOrdQuiet$fEqHideSuccesses$fOrdHideSuccesses $fEqUseColor $fOrdUseColordefaultIngredients defaultMain adjustOption localOption askOption withResource OptionValue runInParallelParThreadKilled InterruptOperatorInfixNInfixLInfixRPrefixPostfixTernRmakeExprParser addPrecLevelpTermbaseGHC.BaseidpInfixNpInfixLpInfixRpTernRsplitOpUnaryexpr2patPbuiltinexpr0expr1expr3expr4NonUnaryVSghc-prim GHC.TypesBoolTrueMmatchValueVN UninitializedString integer-gmpGHC.Integer.TypeInteger onlyPositiveIO ResourceErrorMaybeFalseexceptionResultmempty treeOptionsUseOutsideOfTestUnexpectedStateNotRunningTestsliftA2 Data.Monoid<>*> executeTestcreateTestActions getResourcetimedgetTime Finalizer Initializer ResourceVarResource NotCreated BeingCreatedFailedToCreateCreated Destroyed tryIngredientNothing getEnvOptionssuiteEnvOptionsEnvOptionException BadOption System.ExitexitWithSignalExceptionMonoidstatusMapResultcomputeAlignmentMaximum MinusInfinity