-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Yet another test framework for Haskell
--   
--   Please see the <a>documentation</a>.
@package sandwich
@version 0.1.2.0


-- | Logging functions.
module Test.Sandwich.Logging

-- | Log a message at level <a>LevelDebug</a>.
debug :: (HasCallStack, MonadLogger m) => Text -> m ()

-- | Log a message at level <a>LevelInfo</a>.
info :: (HasCallStack, MonadLogger m) => Text -> m ()

-- | Log a message at level <a>LevelWarn</a>.
warn :: (HasCallStack, MonadLogger m) => Text -> m ()

-- | Log a message at level <a>LevelError</a>.
logError :: (HasCallStack, MonadLogger m) => Text -> m ()

-- | Log with a custom <a>LogLevel</a>.
logOther :: (HasCallStack, MonadLogger m) => LogLevel -> Text -> m ()

-- | Functions for launching processes while capturing their output in the
--   logs.
--   
--   Spawn a process with its stdout and stderr connected to the logging
--   system. Every line output by the process will be fed to a <a>debug</a>
--   call.
createProcessWithLogging :: (MonadIO m, MonadBaseControl IO m, MonadLogger m, HasCallStack) => CreateProcess -> m ProcessHandle

-- | Spawn a process with its stdout and stderr connected to the logging
--   system. Every line output by the process will be fed to a <a>debug</a>
--   call.
createProcessWithLoggingAndStdin :: (MonadIO m, MonadFail m, MonadBaseControl IO m, MonadLogger m, HasCallStack) => CreateProcess -> String -> m ProcessHandle

-- | Higher level version of <a>createProcessWithLogging</a>, accepting a
--   shell command.
callCommandWithLogging :: (MonadIO m, MonadBaseControl IO m, MonadLogger m) => String -> m ()

module Test.Sandwich.TH
getSpecFromFolder :: GetSpecFromFolderOptions -> Q Exp
defaultGetSpecFromFolderOptions :: GetSpecFromFolderOptions
data GetSpecFromFolderOptions
getSpecCombiner :: GetSpecFromFolderOptions -> Name
getSpecIndividualSpecHooks :: GetSpecFromFolderOptions -> Name
getSpecWarnOnParseError :: GetSpecFromFolderOptions -> ShouldWarnOnParseError
data ShouldWarnOnParseError
WarnOnParseError :: ShouldWarnOnParseError
NoWarnOnParseError :: ShouldWarnOnParseError
buildModuleMap :: FilePath -> String -> IO ModuleMap


-- | This module exports the special "primed" versions of the test tree
--   nodes. These primed versions accept an additional options argument,
--   which allows you to do things like control the visibility thresholds
--   of the nodes.
module Test.Sandwich.Nodes

-- | Define a single test example.
it' :: HasCallStack => NodeOptions -> String -> ExampleT context m () -> Free (SpecCommand context m) ()

-- | Define a group of tests.
describe' :: HasCallStack => NodeOptions -> String -> SpecFree context m () -> SpecFree context m ()

-- | Run a group of tests in parallel.
parallel' :: HasCallStack => NodeOptions -> SpecFree context m () -> SpecFree context m ()

-- | Options for an individual test node.
data NodeOptions

-- | Reasonable default node options.
defaultNodeOptions :: NodeOptions

-- | The visibility threshold of the node. See the main docs for an
--   explanation of this.
nodeOptionsVisibilityThreshold :: NodeOptions -> Int

-- | Whether to create a folder in the on-disk test results for this node.
--   Defaults to <a>True</a>, but can be turned off to reduce extraneous
--   folders from nodes like <tt>Parallel</tt>.
nodeOptionsCreateFolder :: NodeOptions -> Bool

-- | Whether to time this node.
nodeOptionsRecordTime :: NodeOptions -> Bool

-- | Introduce a new value and make it available to the child spec tree.
introduce' :: (HasCallStack, Typeable intro) => NodeOptions -> String -> Label l intro -> ExampleT context m intro -> (intro -> ExampleT context m ()) -> SpecFree (LabelValue l intro :> context) m () -> SpecFree context m ()

-- | Introduce a new value in an <a>around</a> fashion, so it can be used
--   with context managers like withFile or bracket.
introduceWith' :: HasCallStack => NodeOptions -> String -> Label l intro -> ((intro -> ExampleT context m [Result]) -> ExampleT context m ()) -> SpecFree (LabelValue l intro :> context) m () -> SpecFree context m ()

-- | Perform an action before a given spec tree.
before' :: HasCallStack => NodeOptions -> String -> ExampleT context m () -> SpecFree context m () -> SpecFree context m ()

-- | Perform an action before each example in a given spec tree.
beforeEach' :: HasCallStack => Maybe SrcLoc -> NodeOptions -> String -> ExampleT context m () -> SpecFree context m () -> SpecFree context m ()

-- | Perform an action after a given spec tree.
after' :: HasCallStack => NodeOptions -> String -> ExampleT context m () -> SpecFree context m () -> SpecFree context m ()

-- | Perform an action after each example in a given spec tree.
afterEach' :: HasCallStack => Maybe SrcLoc -> NodeOptions -> String -> ExampleT context m () -> SpecFree context m () -> SpecFree context m ()

-- | Run an action around the given child subtree. Useful for context
--   managers like withFile or bracket.
around' :: HasCallStack => NodeOptions -> String -> (ExampleT context m [Result] -> ExampleT context m ()) -> SpecFree context m () -> SpecFree context m ()
aroundEach' :: (Monad m, HasCallStack) => Maybe SrcLoc -> NodeOptions -> String -> (ExampleT context m [Result] -> ExampleT context m ()) -> SpecFree context m () -> SpecFree context m ()


-- | Functions for making assertions about test behavior.
module Test.Sandwich.Expectations

-- | General-purpose function to throw a test exception with a
--   <a>String</a>.
expectationFailure :: (HasCallStack, MonadThrow m) => String -> m a

-- | Throws a <a>Pending</a> exception, which will cause the test to be
--   marked as pending.
pending :: (HasCallStack, MonadThrow m) => m a

-- | Throws a <a>Pending</a> exception with a message to add additional
--   details.
pendingWith :: (HasCallStack, MonadThrow m) => String -> m a

-- | Shorthand for a pending test example. You can quickly mark an
--   <a>it</a> node as pending by putting an "x" in front of it.
xit :: (HasCallStack, Monad m, MonadThrow m) => String -> ExampleT context m1 () -> SpecFree context m ()

-- | Assert that a given action should fail with some <a>FailureReason</a>.
shouldFail :: (HasCallStack, MonadCatch m, MonadThrow m) => m () -> m ()

-- | Assert that a given action should fail with some <a>FailureReason</a>
--   matching a predicate.
shouldFailPredicate :: (HasCallStack, MonadCatch m, MonadThrow m) => (FailureReason -> Bool) -> m () -> m ()

-- | Asserts that an action should throw an exception. Accepts a predicate
--   to determine if the exception matches.
shouldThrow :: (HasCallStack, MonadThrow m, MonadCatch m, MonadIO m, Exception e) => m a -> (e -> Bool) -> m ()

-- | Asserts that two things are equal.
shouldBe :: (HasCallStack, MonadThrow m, Eq a, Show a) => a -> a -> m ()

-- | Asserts that two things are not equal.
shouldNotBe :: (HasCallStack, MonadThrow m, Eq a, Show a) => a -> a -> m ()

-- | Asserts that the given list contains a subsequence.
shouldContain :: (HasCallStack, MonadThrow m, Eq a, Show a) => [a] -> [a] -> m ()

-- | Asserts that the given list contains an item matching a predicate.
shouldContainPredicate :: (HasCallStack, MonadThrow m, Eq a, Show a) => [a] -> (a -> Bool) -> m ()

-- | Asserts that the given list does not contain a subsequence.
shouldNotContain :: (HasCallStack, MonadThrow m, Eq a, Show a) => [a] -> [a] -> m ()

-- | Asserts that the given list contains an item matching a predicate.
shouldNotContainPredicate :: (HasCallStack, MonadThrow m, Eq a, Show a) => [a] -> (a -> Bool) -> m ()

-- | Asserts that the given <a>Maybe</a> is <a>Nothing</a>.
shouldBeNothing :: (HasCallStack, MonadThrow m, Show a) => Maybe a -> m ()

-- | Asserts that the given <a>Maybe</a> is <a>Just</a>.
shouldBeJust :: (HasCallStack, MonadThrow m, Show a) => Maybe a -> m ()

-- | Asserts that the given <a>Either</a> is <a>Left</a>.
shouldBeLeft :: (HasCallStack, MonadThrow m, Show a, Show b) => Either a b -> m ()

-- | Asserts that the given <a>Either</a> is <a>Right</a>.
shouldBeRight :: (HasCallStack, MonadThrow m, Show a, Show b) => Either a b -> m ()

-- | Asserts that the given text contains a substring.
textShouldContain :: (HasCallStack, MonadThrow m) => Text -> Text -> m ()

-- | Asserts that the given text does not contain a substring.
textShouldNotContain :: (HasCallStack, MonadThrow m) => Text -> Text -> m ()


-- | Functions for retrieving context information from within tests.
module Test.Sandwich.Contexts

-- | Get a context by its label.
getContext :: (Monad m, HasLabel context l a, HasCallStack, MonadReader context m) => Label l a -> m a

-- | Get the root folder of the on-disk test tree for the current run. Will
--   be <a>Nothing</a> if the run isn't configured to use the disk.
getRunRoot :: (Monad m, HasBaseContext context, MonadReader context m) => m (Maybe FilePath)

-- | Get the on-disk folder corresponding to the current node. Will be
--   <a>Nothing</a> if the run isn't configured to use the disk, or if the
--   current node is configured not to create a folder.
getCurrentFolder :: (HasBaseContext context, MonadReader context m, MonadIO m) => m (Maybe FilePath)

-- | Get the command line options, if configured. Using the
--   <tt>runSandwichWithCommandLineArgs</tt> family of main functions will
--   introduce these, or you can introduce them manually
getCommandLineOptions :: forall a context m. (HasCommandLineOptions context a, MonadReader context m, MonadIO m) => m (CommandLineOptions a)

-- | Get the user command line options, if configured. This just calls
--   <a>getCommandLineOptions</a> and pulls out the user options.
getUserCommandLineOptions :: (HasCommandLineOptions context a, MonadReader context m, MonadIO m) => m a


-- | The silent formatter does nothing except print the test root folder
--   path, if present.
--   
--   This is provided as an explicit formatter so it can print that single
--   line. If you don't want anything at all to be printed, you can just
--   run with no formatters.
--   
--   Documentation can be found <a>here</a>.
module Test.Sandwich.Formatters.Silent
defaultSilentFormatter :: SilentFormatter
silentFormatterPrintRunRoot :: SilentFormatter -> Bool
instance GHC.Show.Show Test.Sandwich.Formatters.Silent.SilentFormatter
instance Test.Sandwich.Types.RunTree.Formatter Test.Sandwich.Formatters.Silent.SilentFormatter


-- | The failure report formatter is like the print formatter, but it only
--   shows failures.
--   
--   Documentation can be found <a>here</a>.
module Test.Sandwich.Formatters.FailureReport
defaultFailureReportFormatter :: FailureReportFormatter
data FailureReportFormatter
failureReportUseColor :: FailureReportFormatter -> Bool
failureReportLogLevel :: FailureReportFormatter -> Maybe LogLevel
failureReportIncludeCallStacks :: FailureReportFormatter -> Bool
failureReportIndentSize :: FailureReportFormatter -> Int
failureReportVisibilityThreshold :: FailureReportFormatter -> Int
instance GHC.Show.Show Test.Sandwich.Formatters.FailureReport.FailureReportFormatter
instance Test.Sandwich.Types.RunTree.Formatter Test.Sandwich.Formatters.FailureReport.FailureReportFormatter


-- | The print formatter prints all results from the test tree from top to
--   bottom, as they become available.
--   
--   Documentation can be found <a>here</a>.
module Test.Sandwich.Formatters.Print
defaultPrintFormatter :: PrintFormatter

-- | Whether to use color in output. Defaults to <a>True</a>.
printFormatterUseColor :: PrintFormatter -> Bool

-- | Log level to show in output. Defaults to <a>LevelWarn</a>.
printFormatterLogLevel :: PrintFormatter -> Maybe LogLevel

-- | Whether to include callstacks with failures.
printFormatterIncludeCallStacks :: PrintFormatter -> Bool

-- | The indentation unit in spaces. Defaults to 4.
printFormatterIndentSize :: PrintFormatter -> Int

-- | Visibility threshold. Nodes above this threshold will not be shown.
printFormatterVisibilityThreshold :: PrintFormatter -> Int
instance Test.Sandwich.Types.RunTree.Formatter Test.Sandwich.Formatters.Print.Types.PrintFormatter

module Test.Sandwich.Options

-- | All the options controlling a test run.
data Options

-- | A reasonable default set of options.
defaultOptions :: Options

-- | Where to save test artifacts (logs, screenshots, failure reports,
--   etc.).
optionsTestArtifactsDirectory :: Options -> TestArtifactsDirectory

-- | Control whether test artifacts are stored to a directory.
data TestArtifactsDirectory

-- | Do not create a test artifacts directory.
TestArtifactsNone :: TestArtifactsDirectory

-- | Use the test artifacts directory at the given path, creating it if
--   necessary.
TestArtifactsFixedDirectory :: FilePath -> TestArtifactsDirectory
[testRootFixed] :: TestArtifactsDirectory -> FilePath

-- | Create a new test artifacts directory under '' test artifacts
--   directory at the given path.
TestArtifactsGeneratedDirectory :: FilePath -> IO FilePath -> TestArtifactsDirectory

-- | The root folder under which test run directories will be created.
[runsRoot] :: TestArtifactsDirectory -> FilePath

-- | Action to generate the new directory name.
[getTestRunDirectoryName] :: TestArtifactsDirectory -> IO FilePath

-- | Minimum test log level to save (has no effect if
--   <a>optionsTestArtifactsDirectory</a> is <a>TestArtifactsNone</a>).
optionsSavedLogLevel :: Options -> Maybe LogLevel

-- | Test log level to store in memory while tests are running. (These logs
--   are presented in formatters, etc.).
optionsMemoryLogLevel :: Options -> Maybe LogLevel

-- | Formatter function for log entries.
optionsLogFormatter :: Options -> LogEntryFormatter

-- | A callback for formatting a log entry to a <a>ByteString</a>.
type LogEntryFormatter = UTCTime -> Loc -> LogSource -> LogLevel -> LogStr -> ByteString

-- | Which formatters to use to output the results of the tests.
optionsFormatters :: Options -> [SomeFormatter]

-- | An existential wrapper around <a>Formatter</a>s
data SomeFormatter
SomeFormatter :: f -> SomeFormatter
class Formatter f

-- | Name of the formatter
formatterName :: Formatter f => f -> String

-- | The main function, executed while the test tree is running
runFormatter :: (Formatter f, MonadLoggerIO m, MonadUnliftIO m, MonadCatch m) => f -> [RunNode BaseContext] -> Maybe (CommandLineOptions ()) -> BaseContext -> m ()

-- | Called after the test tree is completed, can be used to print final
--   results
finalizeFormatter :: (Formatter f, MonadIO m, MonadLogger m, MonadCatch m) => f -> [RunNode BaseContext] -> BaseContext -> m ()

-- | Filter to apply to the text tree before running.
optionsFilterTree :: Options -> Maybe TreeFilter
newtype TreeFilter
TreeFilter :: [String] -> TreeFilter
[unTreeFilter] :: TreeFilter -> [String]

-- | Whether to enable the test timer. When the test timer is present,
--   timing information will be emitted to the project root (if present).
optionsTestTimerType :: Options -> TestTimerType

-- | Whether to skip actually launching the tests. This is useful if you
--   want to see the set of the tests that would be run, or start them
--   manually in the terminal UI.
optionsDryRun :: Options -> Bool

-- | An optional absolute path to the root of the project being tested
--   (i.e. the folder where the cabal file is found). This is useful to
--   provide when the current working directory does not match the project
--   root, for example in multi-project Stack setups. We use this hint to
--   connect <a>CallStack</a> paths (which are relative to the project
--   root) to their actual path on disk.
optionsProjectRoot :: Options -> Maybe FilePath


-- | Internal functionality exposed for sibling libraries such as
--   sandwich-webdriver to use. Should not be used otherwise.
module Test.Sandwich.Internal
type Spec context m = SpecFree context m ()
type SpecFree context m a = Free (SpecCommand context m) a
data SpecCommand context m next

-- | Has-* class for asserting a <a>BaseContext</a> is available.
class HasBaseContext a
class HasLabel context (l :: Symbol) a
data LabelValue (l :: Symbol) a
LabelValue :: a -> LabelValue (l :: Symbol) a
data (a :: *) :> (b :: *)
(:>) :: a -> b -> (:>) (a :: *) (b :: *)
infixr 9 :>
infixr 9 :>
type ExampleM context = ExampleT context IO
newtype ExampleT context m a
ExampleT :: ReaderT context (LoggingT m) a -> ExampleT context m a
[unExampleT] :: ExampleT context m a -> ReaderT context (LoggingT m) a
data RunNodeWithStatus context s l t
[RunNodeBefore] :: {runNodeCommon :: RunNodeCommonWithStatus s l t, runNodeChildren :: [RunNodeWithStatus context s l t], runNodeBefore :: ExampleT context IO ()} -> RunNodeWithStatus context s l t
[RunNodeAfter] :: {runNodeCommon :: RunNodeCommonWithStatus s l t, runNodeChildren :: [RunNodeWithStatus context s l t], runNodeAfter :: ExampleT context IO ()} -> RunNodeWithStatus context s l t
[RunNodeIntroduce] :: Typeable intro => {runNodeCommon :: RunNodeCommonWithStatus s l t, runNodeChildrenAugmented :: [RunNodeWithStatus (LabelValue lab intro :> context) s l t], runNodeAlloc :: ExampleT context IO intro, runNodeCleanup :: intro -> ExampleT context IO ()} -> RunNodeWithStatus context s l t
[RunNodeIntroduceWith] :: {runNodeCommon :: RunNodeCommonWithStatus s l t, runNodeChildrenAugmented :: [RunNodeWithStatus (LabelValue lab intro :> context) s l t], runNodeIntroduceAction :: (intro -> ExampleT context IO [Result]) -> ExampleT context IO ()} -> RunNodeWithStatus context s l t
[RunNodeAround] :: {runNodeCommon :: RunNodeCommonWithStatus s l t, runNodeChildren :: [RunNodeWithStatus context s l t], runNodeActionWith :: ExampleT context IO [Result] -> ExampleT context IO ()} -> RunNodeWithStatus context s l t
[RunNodeDescribe] :: {runNodeCommon :: RunNodeCommonWithStatus s l t, runNodeChildren :: [RunNodeWithStatus context s l t]} -> RunNodeWithStatus context s l t
[RunNodeParallel] :: {runNodeCommon :: RunNodeCommonWithStatus s l t, runNodeChildren :: [RunNodeWithStatus context s l t]} -> RunNodeWithStatus context s l t
[RunNodeIt] :: {runNodeCommon :: RunNodeCommonWithStatus s l t, runNodeExample :: ExampleT context IO ()} -> RunNodeWithStatus context s l t
type RunNodeFixed context = RunNodeWithStatus context Status (Seq LogEntry) Bool
type RunNode context = RunNodeWithStatus context (Var Status) (Var (Seq LogEntry)) (Var Bool)
data RunNodeCommonWithStatus s l t
RunNodeCommonWithStatus :: String -> Int -> Seq Int -> t -> t -> s -> Bool -> Maybe FilePath -> Int -> Bool -> l -> Maybe SrcLoc -> RunNodeCommonWithStatus s l t
[runTreeLabel] :: RunNodeCommonWithStatus s l t -> String
[runTreeId] :: RunNodeCommonWithStatus s l t -> Int
[runTreeAncestors] :: RunNodeCommonWithStatus s l t -> Seq Int
[runTreeToggled] :: RunNodeCommonWithStatus s l t -> t
[runTreeOpen] :: RunNodeCommonWithStatus s l t -> t
[runTreeStatus] :: RunNodeCommonWithStatus s l t -> s
[runTreeVisible] :: RunNodeCommonWithStatus s l t -> Bool
[runTreeFolder] :: RunNodeCommonWithStatus s l t -> Maybe FilePath
[runTreeVisibilityLevel] :: RunNodeCommonWithStatus s l t -> Int
[runTreeRecordTime] :: RunNodeCommonWithStatus s l t -> Bool
[runTreeLogs] :: RunNodeCommonWithStatus s l t -> l
[runTreeLoc] :: RunNodeCommonWithStatus s l t -> Maybe SrcLoc
extractValues :: (forall context. RunNodeWithStatus context s l t -> a) -> RunNodeWithStatus context s l t -> [a]
extractValuesControlRecurse :: (forall context. RunNodeWithStatus context s l t -> (Bool, a)) -> RunNodeWithStatus context s l t -> [a]
getCommons :: RunNodeWithStatus context s l t -> [RunNodeCommonWithStatus s l t]
cancelNode :: RunNode context -> IO ()
data Status
NotStarted :: Status
Running :: UTCTime -> Async Result -> Status
[statusStartTime] :: Status -> UTCTime
[statusAsync] :: Status -> Async Result
Done :: UTCTime -> UTCTime -> Result -> Status
[statusStartTime] :: Status -> UTCTime
[statusEndTime] :: Status -> UTCTime
[statusResult] :: Status -> Result
fixRunTree :: RunNode context -> STM (RunNodeFixed context)

-- | Wait for a tree, catching any synchronous exceptions and returning
--   them as a list
waitForTree :: RunNode context -> IO Result
newtype SomeAsyncExceptionWithEq
SomeAsyncExceptionWithEq :: SomeAsyncException -> SomeAsyncExceptionWithEq
logEntryStr :: LogEntry -> LogStr
countWhere :: (forall context. RunNodeWithStatus context s l t -> Bool) -> [RunNodeWithStatus context s l t] -> Int
isItBlock :: RunNodeWithStatus context s l t -> Bool
isRunningItBlock :: RunNodeWithStatus context Status l t -> Bool
isSuccessItBlock :: RunNodeWithStatus context Status l t -> Bool
isPendingItBlock :: RunNodeWithStatus context Status l t -> Bool
isFailedItBlock :: RunNodeWithStatus context Status l t -> Bool
isFailedBlock :: RunNodeWithStatus context Status l t -> Bool
isDoneItBlock :: RunNodeWithStatus context Status l t -> Bool
isNotStartedItBlock :: RunNodeWithStatus context Status l t -> Bool
formatNominalDiffTime :: NominalDiffTime -> String
startSandwichTree :: Options -> CoreSpec -> IO [RunNode BaseContext]
startSandwichTree' :: BaseContext -> Options -> CoreSpec -> IO [RunNode BaseContext]
runSandwichTree :: Options -> CoreSpec -> IO [RunNode BaseContext]

-- | For 0 repeats, repeat until a failure
runWithRepeat :: Int -> Int -> IO (ExitReason, Int) -> IO ()
baseContextFromOptions :: Options -> IO BaseContext

-- | Gather all node options from a spec
gatherNodeOptions :: Free (SpecCommand context m) r -> [NodeOptions]
gatherMainFunctions :: Free (SpecCommand context m) r -> [NodeModuleInfo]

-- | TODO: get these automatically from mainCommandLineOptions
takenMainOptions :: [Text]
gatherShorthands :: [NodeModuleInfo] -> [(NodeModuleInfo, Text)]

module Test.Sandwich.Formatters.TerminalUI

-- | Default settings for the terminal UI formatter.
defaultTerminalUIFormatter :: TerminalUIFormatter

-- | The initial visibility threshold to use when the formatter starts.
terminalUIVisibilityThreshold :: TerminalUIFormatter -> Int

-- | Whether to show or hide run times.
terminalUIShowRunTimes :: TerminalUIFormatter -> Bool

-- | Whether to show or hide visibility thresholds next to nodes.
terminalUIShowVisibilityThresholds :: TerminalUIFormatter -> Bool

-- | Log level for test log displays.
terminalUILogLevel :: TerminalUIFormatter -> Maybe LogLevel

-- | The initial folding settings to use when the formatter starts.
terminalUIInitialFolding :: TerminalUIFormatter -> InitialFolding

-- | Default value to use for the EDITOR environment variable when one is
--   not provided. If <a>Nothing</a> and EDITOR can't be found, edit
--   commands will do nothing.
--   
--   Here are some recommended values, depending on your preferred editor:
--   
--   <ul>
--   <li>Emacs: <tt>export EDITOR="emacsclient --eval '(progn (find-file
--   FILE) (goto-line LINE) (forward-char (- COLUMN 1))
--   (recenter))'"</tt></li>
--   <li>Terminal Emacs: <tt>export EDITOR="emacsclient -nw --eval '(progn
--   (find-file FILE) (goto-line LINE) (forward-char (- COLUMN 1))
--   (recenter))'"</tt></li>
--   <li>Vim: <tt>export EDITOR="vim +LINE"</tt></li>
--   </ul>
terminalUIDefaultEditor :: TerminalUIFormatter -> Maybe String

-- | Callback to open a source location in your editor. By default, finds
--   the command in the EDITOR environment variable and invokes it with the
--   strings LINE, COLUMN, and FILE replaced with the line number, column,
--   and file path. If FILE is not found in the string, it will be appended
--   to the command after a space. It's also passed a debug callback that
--   accepts a <a>Text</a>; messages logged with this function will go into
--   the formatter logs.
terminalUIOpenInEditor :: TerminalUIFormatter -> Maybe String -> (Text -> IO ()) -> SrcLoc -> IO ()

-- | Custom exception formatters, used to nicely format custom exception
--   types.
terminalUICustomExceptionFormatters :: TerminalUIFormatter -> CustomExceptionFormatters
data InitialFolding
InitialFoldingAllOpen :: InitialFolding
InitialFoldingAllClosed :: InitialFolding
InitialFoldingTopNOpen :: Int -> InitialFolding
data CustomTUIException
CustomTUIExceptionMessageAndCallStack :: Text -> Maybe CallStack -> CustomTUIException
CustomTUIExceptionBrick :: (forall n. Widget n) -> CustomTUIException
isTuiFormatterSupported :: IO Bool
instance Test.Sandwich.Types.RunTree.Formatter Test.Sandwich.Formatters.TerminalUI.Types.TerminalUIFormatter


-- | Miscellaneous exports that need to be exposed, but aren't super
--   interesting. Gathered here to avoid cluttering other files.
module Test.Sandwich.Misc
data ExampleT context m a
type ExampleM context = ExampleT context IO
type Spec context m = SpecFree context m ()
type SpecFree context m a = Free (SpecCommand context m) a
type CoreSpec = Spec BaseContext IO
type TopSpec = forall context. HasBaseContext context => SpecFree context IO ()
type TopSpecWithOptions = forall context. (HasBaseContext context, HasCommandLineOptions context ()) => SpecFree context IO ()
type TopSpecWithOptions' a = forall context. (HasBaseContext context, HasCommandLineOptions context a) => SpecFree context IO ()
isEmptySpec :: forall context. Free (SpecCommand context IO) () -> Bool
data CommandLineOptions a
CommandLineOptions :: FormatterType -> Maybe LogLevel -> Maybe Int -> [String] -> Int -> Maybe String -> Maybe Bool -> Maybe FilePath -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe IndividualTestModule -> CommandLineGoldenOptions -> CommandLineQuickCheckOptions -> CommandLineHedgehogOptions -> CommandLineSlackOptions -> CommandLineWebdriverOptions -> a -> CommandLineOptions a
[optFormatter] :: CommandLineOptions a -> FormatterType
[optLogLevel] :: CommandLineOptions a -> Maybe LogLevel
[optVisibilityThreshold] :: CommandLineOptions a -> Maybe Int
[optTreeFilter] :: CommandLineOptions a -> [String]
[optRepeatCount] :: CommandLineOptions a -> Int
[optFixedRoot] :: CommandLineOptions a -> Maybe String
[optDryRun] :: CommandLineOptions a -> Maybe Bool
[optMarkdownSummaryPath] :: CommandLineOptions a -> Maybe FilePath
[optListAvailableTests] :: CommandLineOptions a -> Maybe Bool
[optPrintGoldenFlags] :: CommandLineOptions a -> Maybe Bool
[optPrintQuickCheckFlags] :: CommandLineOptions a -> Maybe Bool
[optPrintHedgehogFlags] :: CommandLineOptions a -> Maybe Bool
[optPrintSlackFlags] :: CommandLineOptions a -> Maybe Bool
[optPrintWebDriverFlags] :: CommandLineOptions a -> Maybe Bool
[optIndividualTestModule] :: CommandLineOptions a -> Maybe IndividualTestModule
[optGoldenOptions] :: CommandLineOptions a -> CommandLineGoldenOptions
[optQuickCheckOptions] :: CommandLineOptions a -> CommandLineQuickCheckOptions
[optHedgehogOptions] :: CommandLineOptions a -> CommandLineHedgehogOptions
[optSlackOptions] :: CommandLineOptions a -> CommandLineSlackOptions
[optWebdriverOptions] :: CommandLineOptions a -> CommandLineWebdriverOptions
[optUserOptions] :: CommandLineOptions a -> a
data CommandLineQuickCheckOptions
CommandLineQuickCheckOptions :: Maybe Integer -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> CommandLineQuickCheckOptions
[optQuickCheckSeed] :: CommandLineQuickCheckOptions -> Maybe Integer
[optQuickCheckMaxDiscardRatio] :: CommandLineQuickCheckOptions -> Maybe Int
[optQuickCheckMaxSize] :: CommandLineQuickCheckOptions -> Maybe Int
[optQuickCheckMaxSuccess] :: CommandLineQuickCheckOptions -> Maybe Int
[optQuickCheckMaxShrinks] :: CommandLineQuickCheckOptions -> Maybe Int
data CommandLineHedgehogOptions
CommandLineHedgehogOptions :: Maybe String -> Maybe Int -> Maybe Integer -> Maybe Integer -> Maybe Integer -> CommandLineHedgehogOptions
[optHedgehogSeed] :: CommandLineHedgehogOptions -> Maybe String
[optHedgehogSize] :: CommandLineHedgehogOptions -> Maybe Int
[optHedgehogDiscardLimit] :: CommandLineHedgehogOptions -> Maybe Integer
[optHedgehogShrinkLimit] :: CommandLineHedgehogOptions -> Maybe Integer
[optHedgehogShrinkRetries] :: CommandLineHedgehogOptions -> Maybe Integer
data CommandLineSlackOptions
CommandLineSlackOptions :: Maybe String -> Maybe String -> Maybe String -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int64 -> CommandLineSlackOptions
[optSlackToken] :: CommandLineSlackOptions -> Maybe String
[optSlackChannel] :: CommandLineSlackOptions -> Maybe String
[optSlackTopMessage] :: CommandLineSlackOptions -> Maybe String
[optSlackMaxFailures] :: CommandLineSlackOptions -> Maybe Int
[optSlackMaxFailureReasonLines] :: CommandLineSlackOptions -> Maybe Int
[optSlackMaxCallStackLines] :: CommandLineSlackOptions -> Maybe Int
[optSlackVisibilityThreshold] :: CommandLineSlackOptions -> Maybe Int
[optSlackMaxMessageSize] :: CommandLineSlackOptions -> Maybe Int64
data CommandLineWebdriverOptions
CommandLineWebdriverOptions :: Maybe BrowserToUse -> Maybe DisplayType -> Bool -> Bool -> Bool -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> CommandLineWebdriverOptions
[optFirefox] :: CommandLineWebdriverOptions -> Maybe BrowserToUse
[optDisplay] :: CommandLineWebdriverOptions -> Maybe DisplayType
[optFluxbox] :: CommandLineWebdriverOptions -> Bool
[optIndividualVideos] :: CommandLineWebdriverOptions -> Bool
[optErrorVideos] :: CommandLineWebdriverOptions -> Bool
[optSeleniumJar] :: CommandLineWebdriverOptions -> Maybe FilePath
[optChromeBinary] :: CommandLineWebdriverOptions -> Maybe FilePath
[optChromeDriver] :: CommandLineWebdriverOptions -> Maybe FilePath
[optFirefoxBinary] :: CommandLineWebdriverOptions -> Maybe FilePath
[optGeckoDriver] :: CommandLineWebdriverOptions -> Maybe FilePath
data BrowserToUse
UseChrome :: BrowserToUse
UseFirefox :: BrowserToUse
data DisplayType
Current :: DisplayType
Headless :: DisplayType
Xvfb :: DisplayType
commandLineOptionsWithInfo :: Parser a -> Parser (Maybe IndividualTestModule) -> ParserInfo (CommandLineOptions a)
data Label (l :: Symbol) a
Label :: Label (l :: Symbol) a
data LabelValue (l :: Symbol) a
LabelValue :: a -> LabelValue (l :: Symbol) a
class HasLabel context (l :: Symbol) a
data (a :: *) :> (b :: *)
infixr 9 :>

-- | The base context available to every test node. Contains various paths
--   and timing information.
data BaseContext

-- | Has-* class for asserting a <a>BaseContext</a> is available.
class HasBaseContext a

-- | Has-* class for asserting a 'CommandLineOptions a' is available.
type HasCommandLineOptions context a = HasLabel context "commandLineOptions" (CommandLineOptions a)
data Result
Success :: Result
Failure :: FailureReason -> Result
DryRun :: Result
Cancelled :: Result
data FailureReason
Reason :: Maybe CallStack -> String -> FailureReason
[failureCallStack] :: FailureReason -> Maybe CallStack
[failureReason] :: FailureReason -> String
ExpectedButGot :: Maybe CallStack -> ShowEqBox -> ShowEqBox -> FailureReason
[failureCallStack] :: FailureReason -> Maybe CallStack
[failureValue1] :: FailureReason -> ShowEqBox
[failureValue2] :: FailureReason -> ShowEqBox
DidNotExpectButGot :: Maybe CallStack -> ShowEqBox -> FailureReason
[failureCallStack] :: FailureReason -> Maybe CallStack
[failureValue1] :: FailureReason -> ShowEqBox
GotException :: Maybe CallStack -> Maybe String -> SomeExceptionWithEq -> FailureReason
[failureCallStack] :: FailureReason -> Maybe CallStack
[failureMessage] :: FailureReason -> Maybe String
[failureException] :: FailureReason -> SomeExceptionWithEq
Pending :: Maybe CallStack -> Maybe String -> FailureReason
[failureCallStack] :: FailureReason -> Maybe CallStack
[failurePendingMessage] :: FailureReason -> Maybe String
GetContextException :: Maybe CallStack -> SomeExceptionWithEq -> FailureReason
[failureCallStack] :: FailureReason -> Maybe CallStack
[failureException] :: FailureReason -> SomeExceptionWithEq
GotAsyncException :: Maybe CallStack -> Maybe String -> SomeAsyncExceptionWithEq -> FailureReason
[failureCallStack] :: FailureReason -> Maybe CallStack
[failureMessage] :: FailureReason -> Maybe String
[failureAsyncException] :: FailureReason -> SomeAsyncExceptionWithEq
ChildrenFailed :: Maybe CallStack -> Int -> FailureReason
[failureCallStack] :: FailureReason -> Maybe CallStack
[failureNumChildren] :: FailureReason -> Int
RawImage :: Maybe CallStack -> String -> Image -> FailureReason
[failureCallStack] :: FailureReason -> Maybe CallStack
[failureFallback] :: FailureReason -> String
[failureRawImage] :: FailureReason -> Image

-- | A wrapper type for exceptions with attached callstacks. Haskell
--   doesn't currently offer a way to reliably get a callstack from an
--   exception, but if you can throw (or catch+rethrow) this type then
--   we'll unwrap it and present the callstack nicely.
data SomeExceptionWithCallStack
SomeExceptionWithCallStack :: e -> CallStack -> SomeExceptionWithCallStack
newtype SomeExceptionWithEq
SomeExceptionWithEq :: SomeException -> SomeExceptionWithEq
data ExitReason
NormalExit :: ExitReason
SignalExit :: ExitReason

module Test.Sandwich

-- | Run the spec, configuring the options from the command line.
runSandwichWithCommandLineArgs :: Options -> TopSpecWithOptions -> IO ()

-- | Run the spec, configuring the options from the command line and adding
--   user-configured command line options. The options will become
--   available as a test context, which you can access by calling
--   <a>getCommandLineOptions</a>.
runSandwichWithCommandLineArgs' :: forall a. Typeable a => Options -> Parser a -> TopSpecWithOptions' a -> IO ()
parseCommandLineArgs :: forall a. Typeable a => Parser a -> TopSpecWithOptions' a -> IO (CommandLineOptions a)

-- | Run the spec with the given <a>Options</a>.
runSandwich :: Options -> CoreSpec -> IO ()

-- | Run the spec with optional custom <a>CommandLineOptions</a>. When
--   finished, return the exit reason and number of failures.
runSandwich' :: Maybe (CommandLineOptions ()) -> Options -> CoreSpec -> IO (ExitReason, Int)

-- | Define a single test example.
it :: HasCallStack => String -> ExampleT context m () -> Free (SpecCommand context m) ()

-- | Define a group of tests.
describe :: HasCallStack => String -> SpecFree context m () -> SpecFree context m ()

-- | Run a group of tests in parallel.
parallel :: HasCallStack => SpecFree context m () -> SpecFree context m ()

-- | Introduce a new value and make it available to the child spec tree.
introduce :: (HasCallStack, Typeable intro) => String -> Label l intro -> ExampleT context m intro -> (intro -> ExampleT context m ()) -> SpecFree (LabelValue l intro :> context) m () -> SpecFree context m ()

-- | Introduce a new value in an <a>around</a> fashion, so it can be used
--   with context managers like withFile or bracket.
introduceWith :: HasCallStack => String -> Label l intro -> ((intro -> ExampleT context m [Result]) -> ExampleT context m ()) -> SpecFree (LabelValue l intro :> context) m () -> SpecFree context m ()

-- | Perform an action before a given spec tree.
before :: HasCallStack => String -> ExampleT context m () -> SpecFree context m () -> SpecFree context m ()

-- | Same as <a>before</a>, but applied individually to every <a>it</a>
--   node.
beforeEach :: HasCallStack => String -> ExampleT context m () -> SpecFree context m () -> SpecFree context m ()

-- | Perform an action after a given spec tree.
after :: HasCallStack => String -> ExampleT context m () -> SpecFree context m () -> SpecFree context m ()

-- | Same as <a>after</a>, but applied individually to every <a>it</a>
--   node.
afterEach :: HasCallStack => String -> ExampleT context m () -> SpecFree context m () -> SpecFree context m ()

-- | Run an action around the given child subtree. Useful for context
--   managers like withFile or bracket.
around :: HasCallStack => String -> (ExampleT context m [Result] -> ExampleT context m ()) -> SpecFree context m () -> SpecFree context m ()

-- | Same as <a>around</a>, but applied individually to every <a>it</a>
--   node.
aroundEach :: (Monad m, HasCallStack) => String -> (ExampleT context m [Result] -> ExampleT context m ()) -> SpecFree context m () -> SpecFree context m ()

-- | Time a given action with a given profile name and event name. Use when
--   you want to manually specify the profile name.
timeActionByProfile :: (MonadMask m, MonadIO m, MonadReader context m, HasTestTimer context) => ProfileName -> EventName -> m a -> m a

-- | Time a given action with a given event name. This name will be the
--   "stack frame" of the given action in the profiling results. This
--   function will use the current timing profile name.
timeAction :: (MonadMask m, MonadIO m, MonadReader context m, HasBaseContext context, HasTestTimer context) => EventName -> m a -> m a

-- | Introduce a new timing profile name.
withTimingProfile :: Monad m => ProfileName -> SpecFree (LabelValue "testTimerProfile" TestTimerProfile :> context) m () -> SpecFree context m ()

-- | Introduce a new timing profile name dynamically. The given
--   <a>ExampleT</a> should come up with the name and return it.
withTimingProfile' :: Monad m => ExampleT context m ProfileName -> SpecFree (LabelValue "testTimerProfile" TestTimerProfile :> context) m () -> SpecFree context m ()

-- | Wrapper around <a>parallel</a>. Introduces a semaphore to limit the
--   parallelism to N threads.
parallelN :: (MonadBaseControl IO m, MonadIO m, MonadMask m) => Int -> SpecFree (LabelValue "parallelSemaphore" QSem :> context) m () -> SpecFree context m ()
parallelN' :: (MonadBaseControl IO m, MonadIO m, MonadMask m) => NodeOptions -> Int -> SpecFree (LabelValue "parallelSemaphore" QSem :> context) m () -> SpecFree context m ()

-- | Same as <a>parallelN</a>, but extracts the semaphore size from the
--   command line options.
parallelNFromArgs :: forall context a m. (MonadBaseControl IO m, MonadIO m, MonadMask m, HasCommandLineOptions context a) => (CommandLineOptions a -> Int) -> SpecFree (LabelValue "parallelSemaphore" QSem :> context) m () -> SpecFree context m ()
parallelNFromArgs' :: forall context a m. (MonadBaseControl IO m, MonadIO m, MonadMask m, HasCommandLineOptions context a) => NodeOptions -> (CommandLineOptions a -> Int) -> SpecFree (LabelValue "parallelSemaphore" QSem :> context) m () -> SpecFree context m ()
parallelSemaphore :: Label "parallelSemaphore" QSem
type HasParallelSemaphore context = HasLabel context "parallelSemaphore" QSem
defaultParallelNodeOptions :: NodeOptions

module Test.Sandwich.Golden

-- | Runs a Golden test.
golden :: (MonadIO m, MonadThrow m, Eq str, Show str) => Golden str -> Free (SpecCommand context m) ()

-- | Golden for a <a>Text</a>.
goldenText :: String -> Text -> Golden Text

-- | Golden for a <a>String</a>.
goldenString :: String -> String -> Golden String

-- | Golden for an Aeson value (<a>ToJSON</a>/<a>FromJSON</a>).
goldenJSON :: (ToJSON a, FromJSON a) => String -> a -> Golden a

-- | Golden for a general <a>Show</a>/<a>Read</a> type.
goldenShowable :: (Show a, Read a) => String -> a -> Golden a

-- | Make your own <a>Golden</a> constructor by providing
--   <a>goldenWriteToFile</a> and <a>goldenReadFromFile</a>.
mkGolden :: (FilePath -> a -> IO ()) -> (FilePath -> IO a) -> String -> a -> Golden a

-- | Expected output.
goldenOutput :: Golden a -> a

-- | How to write into the golden file the file.
goldenWriteToFile :: Golden a -> FilePath -> a -> IO ()

-- | How to read the file.
goldenReadFromFile :: Golden a -> FilePath -> IO a

-- | Where to read/write the golden file for this test.
goldenFile :: Golden a -> FilePath

-- | Where to save the actual file for this test. If it is <tt>Nothing</tt>
--   then no file is written.
goldenActualFile :: Golden a -> Maybe FilePath

-- | Whether to record a failure the first time this test is run.
goldenFailFirstTime :: Golden a -> Bool


-- | A simple formatter that saves all logs from the test to a file.
--   
--   This is a "secondary formatter," i.e. one that can run in the
--   background while a "primary formatter" (such as the TerminalUI or
--   Print formatters) monopolize the foreground.
--   
--   Documentation can be found <a>here</a>.
module Test.Sandwich.Formatters.LogSaver
defaultLogSaverFormatter :: LogSaverFormatter

-- | Path where logs will be saved.
logSaverPath :: LogSaverFormatter -> LogPath

-- | Minimum log level to save.
logSaverLogLevel :: LogSaverFormatter -> LogLevel

-- | Formatter function for log entries.
logSaverFormatter :: LogSaverFormatter -> LogEntryFormatter

-- | A path under which to save logs.
data LogPath

-- | Interpret the path as relative to the test's run root. (If there is no
--   run root, the logs won't be saved.)
LogPathRelativeToRunRoot :: FilePath -> LogPath

-- | Interpret the path as an absolute path.
LogPathAbsolute :: FilePath -> LogPath

-- | A callback for formatting a log entry to a <a>ByteString</a>.
type LogEntryFormatter = UTCTime -> Loc -> LogSource -> LogLevel -> LogStr -> ByteString
instance GHC.Show.Show Test.Sandwich.Formatters.LogSaver.LogSaverFormatter
instance Test.Sandwich.Types.RunTree.Formatter Test.Sandwich.Formatters.LogSaver.LogSaverFormatter
