!jk      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijSafe k test-karyaGet number of physical cores. This can be overidden with a CPUS environment variable. This is useful if you are running on a VM in CI and don't agree with how many cores it claims to have.l test-karyaParse proccpuinfo for physical cpu count.kmnloSafeVp test-karyaLike q= except don't return dotfiles and it prepends the directory.r test-karyaIf op raised ENOENT, return Nothing.s test-karyaIgnore all IO errors. This is useful when you want to see if a file exists, because some-file/x will not give ENOENT, but ENOTDIR, which is probably isIllegalOperation.t test-karyau specialized to IOError.pvrwsxtNoney test-karya Pretty show.z test-karya8Pretty up a string containing a parseable haskell value.{ test-karyaQPretty up haskell value, unless it's a string, in which case return it directly.Previously I needed this in the REPL since it didn't have a way to say text should be unformatted. I don't need it any more, but it doesn't seem to be hurting so I'll leave it here for now.|yz{Safe-}None*~ test-karya5Will throw a runtime error if the regex has an error! test-karya5Will throw a runtime error if the regex has an error! test-karya'Return (complete_match, [group_match]). test-karya,Half-open ranges of where the regex matches. test-karya_TODO this is not the usual thing where it replaces 1 2 etc., but it replaces the entire match. test-karya2Escape a string so the regex matches it literally. test-karya(entire, [group]) test-karya)(complete_match -> groups -> replacement)~ Safe# test-karyatakeWhile plus one extra test-karyaLike U, except that you can do something with the final state and append that to the list. test-karya,Break right after the function returns True. test-karyamGiven the list after the break, return (pre, post), where pre will be appended to the end of the first list.  SafeTG test-karyaThis is just a list, but is documentation that a return value will never be null, or an argument should never be null. This is for cases where  is too annoying to work with. test-karyanEnumerate an inclusive range. Uses multiplication instead of successive addition to avoid loss of precision.)Also it doesn't require an Enum instance. test-karyaEnumerate a half-open range. test-karyaLike E, but always includes the end, even if it doesn't line up on a step. test-karyaInfinite range. test-karya~Apply a function to the first and last elements. Middle elements are unchanged. A null or singleton list is also unchanged. test-karya(Filter on the fst values returning Just. test-karya(Filter on the snd values returning Just. test-karya1The cartesian product of a list of lists. E.g. [[1, 2], [3, 4]] ->  [[1, 3], [1, 4], [2, 3], [2, 4]]. test-karyaGet xs !! n2, but return Nothing if the index is out of range. test-karyaInsert x into xs at index i. If i> is out of range, insert at the beginning or end of the list. test-karyaQRemove the element at the given index. Do nothing if the index is out of range. test-karyaLike ( but return the removed element as well. test-karyaiModify element at an index by applying a function to it. If the index is out of range, nothing happens. test-karyaNFind an element, then change it. Return Nothing if the element wasn't found. test-karya Similar to b, but will insert an element for an out of range positive index. The list will be extended with deflt,, and the modify function passed a Nothing. test-karya=Move an element from one index to another, or Nothing if the from index was out of range. test-karya$Stable sort on a cheap key function. test-karyaLike , but sort highest-to-lowest. test-karya\Merge sorted lists. If two elements compare equal, the one from the left list comes first. test-karyaIf the heads of the sublists are also sorted I can be lazy in the list of sublists too. This version is optimized for minimal overlap. test-karya This is just  except with a key function. test-karyaLike , but include the key. test-karyaGroup the unsorted list into  (key x, xs) where all xs compare equal after key is applied to them. test-karya Similar to C, but key on the fst element, and strip the key out of the groups. test-karyaLike , but group on the snd element. test-karyaLike groupBy, but the list doesn't need to be sorted, and use a key function instead of equality. The list is sorted by the key, and the groups appear in their original order in the input list. test-karyaGroup each element with all the other elements that compare equal to it. The heads of the groups appear in their original order. test-karya but with a key function. test-karya_Pair each element with the following element. The last element is paired with Nothing. Like !zip xs (drop 1 xs ++ f (last xs)) but only traverses xs once. test-karyaLike 0 but with both preceding and following elements. test-karya This is like P, but it returns the remainder of the longer argument instead of discarding it. test-karyaLike  , but emit s or #s if the list lengths are unequal. test-karyaLike ., but the second list is padded with Nothings. test-karyakReturn the reversed inits paired with the tails. This is like a zipper moving focus along the input list. test-karyaPair a elements up with be elements. If they are equal according to the function, they'll both be Both in the result. If an a is deleted going from a to b#, it will be First, and Second for b.)Kind of like an edit distance, or a diff. test-karya This is like -, except that the index of each pair in the right* list is included. In other words, given  (i, Second y), i is the position of y in the b list. Given  (i, First x), i is where x was deleted from the b list. test-karya9Pair up two lists of sorted pairs by their first element. test-karyaLike 5, but use a key function, and omit the extracted key. test-karya<Sort the lists on with the key functions, then pair them up. test-karyaLike (, but when the lists have the same type. test-karyaPLeft if the val was in the left list but not the right, Right for the converse. test-karyaLike /, but partition by two functions consecutively. test-karya$Split into groups of a certain size. test-karyaTake a list of rows to a list of columns. This is like a zip except for variable-length lists. Similar to zip, the result is trimmed to the length of the shortest row. test-karya Similar to j, except that the result is the length of the longest row and missing columns are Nothing. Analogous to . test-karya)Total variants of unsafe list operations. test-karya)Total variants of unsafe list operations. test-karya]Drop adjacent elts if they are equal after applying the key function. The first elt is kept. test-karyaFilter out elts when the predicate is true for adjacent elts. The first elt is kept, and the later ones are dropped. This is like , except it can compare two elements. E.g. drop_with (>=)) will ensure the sequence is increasing. test-karyaLike  , but return the dropped values. test-karyaLike =, but keep the last adjacent equal elt instead of the first. test-karya This is like j, except that it's not limited to just adjacent elts. The output list is in the same order as the input. test-karyaLike 2, but sort the list, and should be more efficient. test-karyayIf the list doesn't have the given prefix, return the original list and False. Otherwise, strip it off and return True. test-karyaLike 8, but the called function has access to the entire tail. test-karya from the end of the list. test-karyaLike +, but it can transform the spanned sublist. test-karya from the end of the list. test-karya'List initial and final element, if any. test-karya/Split before places where the function matches. .> split_before (==1) [1,2,1] [[], [1, 2], [1]] test-karya.Split after places where the function matches. test-karyaSplit xs on sep , dropping sep from the result. test-karyaLike *, but it returns [] if the input was null. test-karyaLike , but only split once. test-karya#Interspense a separator and concat. test-karyaJBinary join, but the separator is only used if both joinees are non-empty. test-karyaCSplit the list on the points where the given function returns true.This is similar to groupBy9, except this is defined to compare adjacent elements. groupBy_ actually compares to the first element of each group. E.g. you can't group numeric runs with groupBy (a b -> b > a+1). test-karyaReplace sublist from with to in the given list. test-karyaCReplace occurrances of an element with zero or more other elements. test-karyaLike , but monadic. test-karyaCSorted by key. The NonNull group is in the same order as the input. test-karya'([unique], [(used_for_unique, [dups])])t      SafeI test-karya/Pair up elements from each map with equal keys.NoneDNone"$;=V} test-karyaPattern as matched by . test-karyaEspecially expensive to run. test-karyaWrap each test with IO level setup and teardown. Sync exceptions are caught from the test function, so this should only see async exceptions. test-karya)Keep the test name so I can report it in , in -. test-karyaSet . This is a grody hack, but I need it because GHC call stack is off by one, so you get the caller line number, but the callee's function name: -https://ghc.haskell.org/trac/ghc/ticket/11686 test-karya$Check against a function. Use like: checkVal (f x) $ \case -> ... test-karya6Show the values nicely, whether they are equal or not. test-karya"Apply color ranges as produced by .$ test-karyaDStrings in the first list match patterns in the second list, using . test-karyaSFormat multiple lines with an operator between them, on a single line if they fit.% test-karyaWIt's common for Left to be an error msg, or be something that can be converted to one. test-karya/This is a simplified pattern that only has the *+ operator, which is equivalent to regex's .*?J. This reduces the amount of quoting you have to write. You can escape * with a backslash.' test-karyaJThe given pure value should throw an exception that matches the predicate.* test-karyaRun a quickcheck property.+ test-karya for quickcheck., test-karya9Print a msg with a special tag indicating a passing test.- test-karya9Print a msg with a special tag indicating a failing test. test-karyaRemove vt100 color codes. test-karyaGThese codes should probably come from termcap, but I can't be bothered. test-karyaDStrict pshow, so I don't get debug traces interleaved with printing./ test-karya6Get a tmp dir, which will be unique for each test run.0 test-karya.Run the computation with cwd in a new tmp dir.1 test-karya8All tmp files used by tests should go in this directory.FTODO instead of being hardcoded this should be configured per-project. test-karyaequal operator test-karyainequal operator test-karyazIf True then equal is expected so inequal will be highlighted red. Otherwise, inequal is expected and highlighted green. test-karyaTrue if as are equal test-karya(out, in) pairs# !"#$%&'()*+,-./012# "!#$%&'(,-)*+./012 None !"#$%&'()*+,-. !"#$%&'()*+,-. Safe !"#$%&'(Safe]) test-karyaSThis always terminates the conversation, and effectively marks the channel closed.* test-karyaHave a conversation with a subprocess. This doesn't use ptys, so this will only work if the subprocess explicitly doesn't use block buffering.+,-./0)*NoneV]^: test-karyaNThis is a simple channel which is written to once, and read from until empty.H test-karyaName of the test function.I test-karya Run the test.J test-karyaTest module filename.K test-karya&Line of the test function declaration.L test-karya#Module-level metadata, declared as meta in the test module toplevel.Q test-karya&Called by the generated main function.V test-karyaIsolate the test by running it in a subprocess. I'm not sure if this is necessary, but I believe at the time GUI-using tests would crash each other without it. Presumably they left some GUI state around that process exit will clean up.W test-karyaDRun tests in parallel, redirecting stdout and stderr to each output.X test-karya>Pull tests off the queue and feed them to a single subprocess.Z test-karya>Signal to the caller that the current batch of tests are done.[ test-karya]Match all tests whose names match any regex, or if a test is an exact match, just that test.] test-karyaTry to save and restore any process level state in case the test messes with it. Currently this just restores CWD, but probably there is more than that. For actual isolation probably a subprocess is necessary.b test-karyaSEmpty the directory, but don't remove it entirely, in case it's /tmp or something.f test-karya8Collect lines before and after each failure for context.I collect before because that's where debugging info about that test is likely to show up, and I collect after because the failure output may have multiple lines.It can be confusing that I can get the failure lines of the previous test as context for the current one. To fix that I'd have to explicitly mark all lines of the failure, or put some ending marker afterwards. It's not hard but maybe not worth it.e test-karya)(failureContext, failures, checks, tests)f test-karya2Just context for a failure, Nothing for a success.-:;<>=?EDBA@CFGLKJIHMNOPQRSTUVWXYZ[\]^_`abcdef-FGLKJIHMNO?EDBA@C<>=PQRSTUVWXYZ[\]^:;_`abcdefSafe1 test-karyaThis will be fooled by a {- or -} inside a string. I don't strip -- comments because the extract functions look for left justified text.2 test-karyaLike 3, but break on two things. 45678912:;<=> !"##$%&&'()*+,-./0123456789:;<=>?@ABCDEFGHHIJKLMNIOPQRRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<    z                                    !"#$%&'()*+,+-./01023456789 : ; < = >?@AB9CDEFG7HIJKLMNOPQRST'test-karya-0.0.2-4OFPSR9URcWJ6xbWUzCDlPEL.Test.ApproxEqEL.Test.TestingEL.Test.RunTestsEL.Private.CpuEL.Private.FileEL.Private.PPrintEL.Private.RangesEL.Private.RegexEL.Private.ThenEL.Private.SeqEL.Private.MapEL.Test.GlobalGlobalEL.Private.ProcessEL.Private.ExtractHsApproxEqeqcompare$fApproxEqText$fApproxEq(,,,)$fApproxEq(,,) $fApproxEq(,)$fApproxEqEither$fApproxEqMaybe $fApproxEq[]$fApproxEqBool$fApproxEqInteger $fApproxEqInt$fApproxEqChar$fApproxEqDouble$fApproxEqFloatPatternTagLarge ModuleMeta initializetagsConfigconfigTestNamemodifyTestConfig withTestNamecheckcheckVal moduleMetaequalequalFmtnotEqual rightEqualequalf stringsLikeleftLikematchthrowsioEqual expectRight quickcheckqcEqualsuccessfailurepprint uniqueTmpDirinTmpDir tmpBaseDirforce$fTextLikeText $fTextLike[] $fShowConfig$fEqTag $fShowTag$fShowNumbered$fShowColorCodeQueueJobsAutoNJobsFlag CheckOutput ClearDirsListOutput SubprocessTest testSymNametestRun testFilenametestLinetestModuleMeta_testModuleMetatestName metaPrefixoptionsrun quitWithUsagerunTestsgetJobs runOutputrunInSubprocess runParallel jobThread subprocesstestsCompleteLine matchingTestsrunTestisolatecatchnewQueue takeQueue whileJustclearDirectory checkOutputs readFileEmpty extractStatsextractFailures$fEqJobs $fShowJobs$fEqFlag $fShowFlag physicalCoreslinuxPhysicalCoresgetPhysicalCoresenvCoresuniquelistdirectory-1.3.1.5System.DirectorygetDirectoryContents ignoreEnoent ignoreIOErrortryIObaseControl.Exception.Basetry writeLines ignoreEOF ignoreErrorpshowformat format_str merge_sorted compileUnsafecompileOptionsUnsafegroups groupRanges substituteescapesubstituteGroups(pcre-light-0.4.0.4-uOVONiujCrFtQK1BvbOV0Text.Regex.PCRE.Light.BaseRegexOptionCaseInsensitiveDotAll MultilinecompilecompileOptionsmatches takeWhile1 mapAccumLData.Traversablebreak1break takeWhiletakefilterspanmapMNonNullGHC.BaseNonEmptyrangerange' range_endrange_ first_last map_maybe_fst map_maybe_snd cartesianat insert_at remove_attake_at modify_at find_modify update_atmovesort_onreverse_sort_onmergemerge_asc_listsgroup_adjacent Data.OldListgroupBykeyed_group_adjacentkeyed_group_sort group_fst group_snd group_sortgroup_stable_with group_stablezip_next zip_neighbors zip_remainderGHC.Listzip zip_paddedFirstSecondzip_padded_sndzipper equal_pairs indexed_pairs pair_sortedpair_sorted_onpair_onpair_on1diff partition2 partitionchunkedrotaterotate2headlast drop_dups drop_withpartition_dupsdrop_initial_dups unique_on unique_sort drop_prefix break_tailsspan_end span_whilespan_end_whileviewr split_before split_aftersplit split_nullsplit1joinjoin2 split_betweenreplacereplace1 mapAccumLMPairedBoth enumeratekey_on key_on_snd key_on_justmap_headmap_tailmap_initmap_lastmin_onmax_on minimum_on maximum_onminimummaximum ne_minimum ne_maximum insert_onmerge_bymerge_on merge_listskeyed_group_stable zip_nextszip_prev paired_second paired_firstpartition_pairedindexed_pairs_on partition_ontailrtake rtake_whilerdrop rdrop_whilelstriprstripstrip drop_suffixne_viewr break_betweencountpairspatternMatches prettyComparehighlightLines diffRangesfmtLines stripColors failureColor splitRanges<> Control.Monadunlessforever Data.Functorvoid Data.MaybemapMaybe fromMaybewhencontainers-0.5.11.0Data.Map.InternalMap text-1.2.3.0Data.Text.InternalTexttxtuntxtshowtwhenJust concatMapMExit conversationTalkInEOFTalkOutStderrStdout stripComments breakOnFirst Data.TextbreakOnWarningErrorprocessheader extractFilestypeDeclarationsmoduleDeclaration makeImport pathToModuledie