sandwich-0.3.0.0: Yet another test framework for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Sandwich.Misc

Description

Miscellaneous exports that need to be exposed, but aren't super interesting. Gathered here to avoid cluttering other files.

Synopsis

The example monad

data ExampleT context m a Source #

Instances

Instances details
MonadBaseControl b m => MonadBaseControl b (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Associated Types

type StM (ExampleT context m) a #

Methods

liftBaseWith :: (RunInBase (ExampleT context m) b -> b a) -> ExampleT context m a #

restoreM :: StM (ExampleT context m) a -> ExampleT context m a #

Monad m => MonadReader context (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

ask :: ExampleT context m context #

local :: (context -> context) -> ExampleT context m a -> ExampleT context m a #

reader :: (context -> a) -> ExampleT context m a #

MonadBase b m => MonadBase b (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

liftBase :: b α -> ExampleT context m α #

MonadTransControl (ExampleT context) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Associated Types

type StT (ExampleT context) a #

Methods

liftWith :: Monad m => (Run (ExampleT context) -> m a) -> ExampleT context m a #

restoreT :: Monad m => m (StT (ExampleT context) a) -> ExampleT context m a #

MonadTrans (ExampleT context) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

lift :: Monad m => m a -> ExampleT context m a #

MonadIO m => MonadFail (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

fail :: String -> ExampleT context m a #

MonadIO m => MonadIO (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

liftIO :: IO a -> ExampleT context m a #

(Applicative m, Alternative (LoggingT m)) => Alternative (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

empty :: ExampleT context m a #

(<|>) :: ExampleT context m a -> ExampleT context m a -> ExampleT context m a #

some :: ExampleT context m a -> ExampleT context m [a] #

many :: ExampleT context m a -> ExampleT context m [a] #

Applicative m => Applicative (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

pure :: a -> ExampleT context m a #

(<*>) :: ExampleT context m (a -> b) -> ExampleT context m a -> ExampleT context m b #

liftA2 :: (a -> b -> c) -> ExampleT context m a -> ExampleT context m b -> ExampleT context m c #

(*>) :: ExampleT context m a -> ExampleT context m b -> ExampleT context m b #

(<*) :: ExampleT context m a -> ExampleT context m b -> ExampleT context m a #

Functor m => Functor (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

fmap :: (a -> b) -> ExampleT context m a -> ExampleT context m b #

(<$) :: a -> ExampleT context m b -> ExampleT context m a #

Monad m => Monad (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

(>>=) :: ExampleT context m a -> (a -> ExampleT context m b) -> ExampleT context m b #

(>>) :: ExampleT context m a -> ExampleT context m b -> ExampleT context m b #

return :: a -> ExampleT context m a #

MonadCatch m => MonadCatch (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

catch :: (HasCallStack, Exception e) => ExampleT context m a -> (e -> ExampleT context m a) -> ExampleT context m a #

MonadMask m => MonadMask (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

mask :: HasCallStack => ((forall a. ExampleT context m a -> ExampleT context m a) -> ExampleT context m b) -> ExampleT context m b #

uninterruptibleMask :: HasCallStack => ((forall a. ExampleT context m a -> ExampleT context m a) -> ExampleT context m b) -> ExampleT context m b #

generalBracket :: HasCallStack => ExampleT context m a -> (a -> ExitCase b -> ExampleT context m c) -> (a -> ExampleT context m b) -> ExampleT context m (b, c) #

MonadThrow m => MonadThrow (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

throwM :: (HasCallStack, Exception e) => e -> ExampleT context m a #

MonadIO m => MonadLogger (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

monadLoggerLog :: ToLogStr msg => Loc -> LogSource -> LogLevel -> msg -> ExampleT context m () #

MonadIO m => MonadLoggerIO (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

askLoggerIO :: ExampleT context m (Loc -> LogSource -> LogLevel -> LogStr -> IO ()) #

(MonadIO m, MonadUnliftIO m) => MonadUnliftIO (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

withRunInIO :: ((forall a. ExampleT context m a -> IO a) -> IO b) -> ExampleT context m b #

type StT (ExampleT context) a Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

type StT (ExampleT context) a = StT LoggingT (StT (ReaderT context) a)
type StM (ExampleT context m) a Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

type StM (ExampleT context m) a = ComposeSt (ExampleT context) m a

type ExampleM context = ExampleT context IO Source #

Spec types

type Spec context m = SpecFree context m () Source #

type SpecFree context m a = Free (SpecCommand context m) a Source #

type TopSpec = forall context. (HasBaseContext context, Typeable context) => SpecFree context IO () Source #

type TopSpecWithOptions = forall context. (Typeable context, HasBaseContext context, HasCommandLineOptions context (), HasSomeCommandLineOptions context) => SpecFree context IO () Source #

type TopSpecWithOptions' a = forall context. (Typeable context, HasBaseContext context, HasCommandLineOptions context a, HasSomeCommandLineOptions context) => SpecFree context IO () Source #

isEmptySpec :: forall context. Free (SpecCommand context IO) () -> Bool Source #

Command line options

data BrowserToUse Source #

Constructors

UseChrome 
UseFirefox 

Instances

Instances details
Show BrowserToUse Source # 
Instance details

Defined in Test.Sandwich.Types.ArgParsing

Labels

data Label (l :: Symbol) a Source #

Constructors

Label 

data LabelValue (l :: Symbol) a Source #

Constructors

LabelValue 

Fields

Instances

Instances details
HasLabel (LabelValue l a :> context) l a Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

getLabelValue :: Label l a -> (LabelValue l a :> context) -> a

HasLabel (LabelValue l a) l a Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

getLabelValue :: Label l a -> LabelValue l a -> a

class HasLabel context (l :: Symbol) a Source #

Minimal complete definition

getLabelValue

Instances

Instances details
HasLabel (LabelValue l a :> context) l a Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

getLabelValue :: Label l a -> (LabelValue l a :> context) -> a

HasLabel context l a => HasLabel (intro :> context) l a Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

getLabelValue :: Label l a -> (intro :> context) -> a

HasLabel (LabelValue l a) l a Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

getLabelValue :: Label l a -> LabelValue l a -> a

data (a :: Type) :> (b :: Type) infixr 9 Source #

Instances

Instances details
(Show a, Show b) => Show (a :> b) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

showsPrec :: Int -> (a :> b) -> ShowS #

show :: (a :> b) -> String #

showList :: [a :> b] -> ShowS #

HasBaseContext context => HasBaseContext (intro :> context) Source # 
Instance details

Defined in Test.Sandwich.Types.RunTree

Methods

getBaseContext :: (intro :> context) -> BaseContext

modifyBaseContext :: (intro :> context) -> (BaseContext -> BaseContext) -> intro :> context

HasLabel (LabelValue l a :> context) l a Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

getLabelValue :: Label l a -> (LabelValue l a :> context) -> a

HasLabel context l a => HasLabel (intro :> context) l a Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

getLabelValue :: Label l a -> (intro :> context) -> a

Context classes

data BaseContext Source #

The base context available to every test node. Contains various paths and timing information.

class HasBaseContext a Source #

Has-* class for asserting a BaseContext is available.

Minimal complete definition

getBaseContext, modifyBaseContext

Instances

Instances details
HasBaseContext BaseContext Source # 
Instance details

Defined in Test.Sandwich.Types.RunTree

HasBaseContext context => HasBaseContext (intro :> context) Source # 
Instance details

Defined in Test.Sandwich.Types.RunTree

Methods

getBaseContext :: (intro :> context) -> BaseContext

modifyBaseContext :: (intro :> context) -> (BaseContext -> BaseContext) -> intro :> context

type HasBaseContextMonad context m = (HasBaseContext context, MonadReader context m) Source #

type HasCommandLineOptions context a = HasLabel context "commandLineOptions" (CommandLineOptions a) Source #

Has-* class for asserting a 'CommandLineOptions a' is available.

type HasSomeCommandLineOptions context = HasLabel context "someCommandLineOptions" SomeCommandLineOptions Source #

Result types

data Result Source #

Instances

Instances details
Show Result Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Eq Result Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

(==) :: Result -> Result -> Bool #

(/=) :: Result -> Result -> Bool #

Show (Async Result) Source # 
Instance details

Defined in Test.Sandwich.Types.RunTree

data FailureReason Source #

data SomeExceptionWithCallStack Source #

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.

Constructors

forall e.Exception e => SomeExceptionWithCallStack e CallStack 

data ExitReason Source #

Constructors

NormalExit 
SignalExit 

Instances

Instances details
Show ExitReason Source # 
Instance details

Defined in Test.Sandwich.Types.General

Eq ExitReason Source # 
Instance details

Defined in Test.Sandwich.Types.General