sandwich-0.1.0.3: Yet another test framework for Haskell
Safe HaskellNone
LanguageHaskell2010

Test.Sandwich.Internal

Description

Internal functionality exposed for sibling libraries such as sandwich-webdriver to use. Should not be used otherwise.

Synopsis

Documentation

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

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

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

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

Minimal complete definition

getLabelValue

Instances

Instances details
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 :> 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

data LabelValue (l :: Symbol) a Source #

Constructors

LabelValue a 

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

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

Constructors

a :> b infixr 9 

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 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 :> context) l a Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

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

type ExampleM context = ExampleT context IO Source #

newtype ExampleT context m a Source #

Constructors

ExampleT 

Fields

Instances

Instances details
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 α #

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 #

MonadTrans (ExampleT context) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

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

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 #

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 #

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, MonadThrow m) => MonadFail (ExampleT context m) Source # 
Instance details

Defined in Test.Sandwich.Types.Spec

Methods

fail :: String -> 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 #

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

Defined in Test.Sandwich.Types.Spec

Methods

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

(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 #

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

Defined in Test.Sandwich.Types.Spec

Methods

throwM :: Exception e => e -> ExampleT context m a #

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

Defined in Test.Sandwich.Types.Spec

Methods

catch :: 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 :: ((forall a. ExampleT context m a -> ExampleT context m a) -> ExampleT context m b) -> ExampleT context m b #

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

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

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 ()) #

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

data RunNodeWithStatus context s l t where Source #

Constructors

RunNodeBefore 

Fields

RunNodeAfter 

Fields

RunNodeIntroduce 

Fields

RunNodeIntroduceWith 

Fields

RunNodeAround 

Fields

RunNodeDescribe 

Fields

RunNodeParallel 

Fields

RunNodeIt 

Fields

type RunNodeFixed context = RunNodeWithStatus context Status (Seq LogEntry) Bool Source #

type RunNode context = RunNodeWithStatus context (Var Status) (Var (Seq LogEntry)) (Var Bool) Source #

extractValues :: (forall context. RunNodeWithStatus context s l t -> a) -> RunNodeWithStatus context s l t -> [a] Source #

extractValuesControlRecurse :: (forall context. RunNodeWithStatus context s l t -> (Bool, a)) -> RunNodeWithStatus context s l t -> [a] Source #

cancelNode :: RunNode context -> IO () Source #

data Status Source #

Instances

Instances details
Eq Status Source # 
Instance details

Defined in Test.Sandwich.Types.RunTree

Methods

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

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

Show Status Source # 
Instance details

Defined in Test.Sandwich.Types.RunTree

fixRunTree :: RunNode context -> STM (RunNodeFixed context) Source #

waitForTree :: RunNode context -> IO Result Source #

Wait for a tree, catching any synchronous exceptions and returning them as a list

logEntryStr :: LogEntry -> LogStr Source #