hsExprTest-3.6.5: Expression Testing
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Expr.Config

Description

Type safe extensible test configuration. See getConfig for the access of configuration values. This is bassically a heterogeneous map type which is indexed by special keys which carry with themselves the information about the type of the corresponding value.

Synopsis

Test Configuration

newtype TestConfig #

Test configration, should be accessed only using the getConfig function.

Constructors

TestConfig [ConfigEntry] 

getConfig :: forall ct. (Typeable ct, Eq ct) => TestConfig -> ct -> Maybe (ConfigValue ct) #

Access to test configuration using test configuration keys. Suppose we have a test configuration tc which contains DegenType and Expression entries (and no other entries):

>>> tc `getConfig` Expression
Just "foo"
>>> tc `getConfig` DegenType
Just TEqual
>>> tc `getConfig` JournalFd
Nothing

Please note that the type of value depends on the value (and therefore a type) of the key.

type family ConfigValue ct where ... #

A mapping from key types to corresponding types of values.

Test Configuration Keys

data Expression #

A key for getting expression, value will be of type ExprName

Constructors

Expression 

Instances

Instances details
Show Expression # 
Instance details

Defined in Test.Expr.Config

Methods

showsPrec :: Int -> Expression -> ShowS

show :: Expression -> String

showList :: [Expression] -> ShowS

Eq Expression # 
Instance details

Defined in Test.Expr.Config

Methods

(==) :: Expression -> Expression -> Bool

(/=) :: Expression -> Expression -> Bool

type ExprName = String #

data JournalFd #

A key for getting journal, value will be of type JournalSink

Constructors

JournalFd 

Instances

Instances details
Show JournalFd # 
Instance details

Defined in Test.Expr.Config

Methods

showsPrec :: Int -> JournalFd -> ShowS

show :: JournalFd -> String

showList :: [JournalFd] -> ShowS

Eq JournalFd # 
Instance details

Defined in Test.Expr.Config

Methods

(==) :: JournalFd -> JournalFd -> Bool

(/=) :: JournalFd -> JournalFd -> Bool

data TypeOrd #

A key for getting TypeOrder, value will be of type TypeOrder

Constructors

TypeOrd 

Instances

Instances details
Show TypeOrd # 
Instance details

Defined in Test.Expr.Config

Methods

showsPrec :: Int -> TypeOrd -> ShowS

show :: TypeOrd -> String

showList :: [TypeOrd] -> ShowS

Eq TypeOrd # 
Instance details

Defined in Test.Expr.Config

Methods

(==) :: TypeOrd -> TypeOrd -> Bool

(/=) :: TypeOrd -> TypeOrd -> Bool

data TestPattern #

A key for getting test value pattern, value will be of type Q Pat

Constructors

TestPattern 

Instances

Instances details
Show TestPattern # 
Instance details

Defined in Test.Expr.Config

Methods

showsPrec :: Int -> TestPattern -> ShowS

show :: TestPattern -> String

showList :: [TestPattern] -> ShowS

Eq TestPattern # 
Instance details

Defined in Test.Expr.Config

Methods

(==) :: TestPattern -> TestPattern -> Bool

(/=) :: TestPattern -> TestPattern -> Bool

data DegenType #

A key for getting test degeneration type, value will be of type Q Type

Constructors

DegenType 

Instances

Instances details
Show DegenType # 
Instance details

Defined in Test.Expr.Config

Methods

showsPrec :: Int -> DegenType -> ShowS

show :: DegenType -> String

showList :: [DegenType] -> ShowS

Eq DegenType # 
Instance details

Defined in Test.Expr.Config

Methods

(==) :: DegenType -> DegenType -> Bool

(/=) :: DegenType -> DegenType -> Bool

Low-Level Interface

data ConfigEntry where #

Constructors

ConfigEntry :: forall ct. Typeable ct => ct -> ConfigValue ct -> ConfigEntry 

liftSafeTH :: TestConfig -> Exp #

This will lift options safe for use in evalutors to a TemplateHaskell expression which can be passed to the evaluator.