fixie-1.0.0: Opininated testing framework for mtl style (spies, stubs, and mocks)

Safe HaskellNone
LanguageHaskell2010

Test.Fixie

Synopsis

Documentation

newtype Note Source #

Constructors

Note Text 

Instances

Eq Note Source # 

Methods

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

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

Show Note Source # 

Methods

showsPrec :: Int -> Note -> ShowS #

show :: Note -> String #

showList :: [Note] -> ShowS #

IsString Note Source # 

Methods

fromString :: String -> Note #

newtype Call Source #

Constructors

Call 

Fields

data FixieT f e m a Source #

Instances

Monad m => MonadError e (FixieT f e m) Source # 

Methods

throwError :: e -> FixieT f e m a #

catchError :: FixieT f e m a -> (e -> FixieT f e m a) -> FixieT f e m a #

MonadTrans (FixieT f e) Source # 

Methods

lift :: Monad m => m a -> FixieT f e m a #

Monad m => Monad (FixieT f e m) Source # 

Methods

(>>=) :: FixieT f e m a -> (a -> FixieT f e m b) -> FixieT f e m b #

(>>) :: FixieT f e m a -> FixieT f e m b -> FixieT f e m b #

return :: a -> FixieT f e m a #

fail :: String -> FixieT f e m a #

Functor m => Functor (FixieT f e m) Source # 

Methods

fmap :: (a -> b) -> FixieT f e m a -> FixieT f e m b #

(<$) :: a -> FixieT f e m b -> FixieT f e m a #

Monad m => Applicative (FixieT f e m) Source # 

Methods

pure :: a -> FixieT f e m a #

(<*>) :: FixieT f e m (a -> b) -> FixieT f e m a -> FixieT f e m b #

(*>) :: FixieT f e m a -> FixieT f e m b -> FixieT f e m b #

(<*) :: FixieT f e m a -> FixieT f e m b -> FixieT f e m a #

type FixieM f e = FixieT f e Identity Source #

toSet :: Ord a => [a] -> Set a Source #

note :: Monad m => Note -> FixieT f e m () Source #

getFixture :: Monad m => FixieT f e m (f (FixieT f e m)) Source #

getFunction :: Monad m => (f (FixieT f e m) -> a) -> FixieT f e m a Source #

captureCall :: Monad m => Call -> FixieT f e m () Source #

outputNotesFunctionsT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Either e a, [Note], [Function]) Source #

outputNotesFunctionsetT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Either e a, [Note], Set Function) Source #

outputFunctionsNotesT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Either e a, [Function], [Note]) Source #

outputFunctionsetNotesT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Either e a, Set Function, [Note]) Source #

valueNotesFunctionsT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m (a, [Note], [Function]) Source #

valueNotesFunctionsetT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m (a, [Note], Set Function) Source #

valueFunctionsNotesT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m (a, [Function], [Note]) Source #

valueFunctionsetNotesT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m (a, Set Function, [Note]) Source #

notesOutputFunctionsT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m ([Note], Either e a, [Function]) Source #

notesOutputFunctionsetT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m ([Note], Either e a, Set Function) Source #

notesValueFunctionsT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m ([Note], a, [Function]) Source #

notesValueFunctionsetT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m ([Note], a, Set Function) Source #

notesFunctionsOutputT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m ([Note], [Function], Either e a) Source #

notesFunctionsetOutputT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m ([Note], Set Function, Either e a) Source #

notesFunctionsValueT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m ([Note], [Function], a) Source #

notesFunctionsetValueT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m ([Note], Set Function, a) Source #

functionsOutputNotesT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m ([Function], Either e a, [Note]) Source #

functionsValueNotesT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m ([Function], a, [Note]) Source #

functionsNotesOutputT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m ([Function], [Note], Either e a) Source #

functionsNotesValueT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m ([Function], [Note], a) Source #

functionsetOutputNotesT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Set Function, Either e a, [Note]) Source #

functionsetValueNotesT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m (Set Function, a, [Note]) Source #

functionsetNotesOutputT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Set Function, [Note], Either e a) Source #

functionsetNotesValueT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m (Set Function, [Note], a) Source #

outputNotesT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Either e a, [Note]) Source #

outputFunctionsT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Either e a, [Function]) Source #

outputFunctionsetT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Either e a, Set Function) Source #

valueNotesT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m (a, [Note]) Source #

valueFunctionsT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m (a, [Function]) Source #

valueFunctionsetT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m (a, Set Function) Source #

notesOutputT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m ([Note], Either e a) Source #

notesValueT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m ([Note], a) Source #

notesFunctionsT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m ([Note], [Function]) Source #

notesFunctionsetT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m ([Note], Set Function) Source #

functionsOutputT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m ([Function], Either e a) Source #

functionsValueT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m ([Function], a) Source #

functionsNotesT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m ([Function], [Note]) Source #

functionsetOutputT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Set Function, Either e a) Source #

functionsetValueT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m (Set Function, a) Source #

functionsetNotesT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Set Function, [Note]) Source #

outputT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Either e a) Source #

valueT :: Monad m => f (FixieT f Void m) -> FixieT f Void m a -> m a Source #

notesT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m [Note] Source #

functionsT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m [Function] Source #

functionsetT :: Monad m => f (FixieT f e m) -> FixieT f e m a -> m (Set Function) Source #

outputNotesFunctionsM :: f (FixieM f e) -> FixieM f e a -> (Either e a, [Note], [Function]) Source #

outputFunctionsNotesM :: f (FixieM f e) -> FixieM f e a -> (Either e a, [Function], [Note]) Source #

notesOutputFunctionsM :: f (FixieM f e) -> FixieM f e a -> ([Note], Either e a, [Function]) Source #

notesFunctionsOutputM :: f (FixieM f e) -> FixieM f e a -> ([Note], [Function], Either e a) Source #

functionsOutputNotesM :: f (FixieM f e) -> FixieM f e a -> ([Function], Either e a, [Note]) Source #

functionsNotesOutputM :: f (FixieM f e) -> FixieM f e a -> ([Function], [Note], Either e a) Source #

outputNotesM :: f (FixieM f e) -> FixieM f e a -> (Either e a, [Note]) Source #

outputFunctionsM :: f (FixieM f e) -> FixieM f e a -> (Either e a, [Function]) Source #

outputFunctionsetM :: f (FixieM f e) -> FixieM f e a -> (Either e a, Set Function) Source #

valueNotesM :: f (FixieM f Void) -> FixieM f Void a -> (a, [Note]) Source #

notesOutputM :: f (FixieM f e) -> FixieM f e a -> ([Note], Either e a) Source #

notesValueM :: f (FixieM f Void) -> FixieM f Void a -> ([Note], a) Source #

notesFunctionsM :: f (FixieM f e) -> FixieM f e a -> ([Note], [Function]) Source #

notesFunctionsetM :: f (FixieM f e) -> FixieM f e a -> ([Note], Set Function) Source #

functionsOutputM :: f (FixieM f e) -> FixieM f e a -> ([Function], Either e a) Source #

functionsNotesM :: f (FixieM f e) -> FixieM f e a -> ([Function], [Note]) Source #

functionsetOutputM :: f (FixieM f e) -> FixieM f e a -> (Set Function, Either e a) Source #

functionsetNotesM :: f (FixieM f e) -> FixieM f e a -> (Set Function, [Note]) Source #

outputM :: f (FixieM f e) -> FixieM f e a -> Either e a Source #

valueM :: f (FixieM f Void) -> FixieM f Void a -> a Source #

notesM :: f (FixieM f e) -> FixieM f e a -> [Note] Source #

functionsM :: f (FixieM f e) -> FixieM f e a -> [Function] Source #

functionsetM :: f (FixieM f e) -> FixieM f e a -> Set Function Source #

mkFixture :: String -> [Type] -> Q [Dec] Source #

A Template Haskell function that generates a fixture record type with a given name that reifies the set of typeclass dictionaries provided, as described in the module documentation for Control.Monad.Fixie.TH. For example, the following splice would create a new record type called Fixture with fields and instances for typeclasses called Foo and Bar:

mkFixture "Fixture" [ts| Foo, Bar |]

mkFixture supports types in the same format that deriving clauses do when used with the GeneralizedNewtypeDeriving GHC extension, so deriving multi-parameter typeclasses is possible if they are partially applied. For example, the following is valid:

class MultiParam a m where
  doSomething :: a -> m ()

mkFixture "Fixture" [ts| MultiParam String |]

def :: Default a => a #

The default value for this type.

ts :: QuasiQuoter Source #

A quasi-quoter like the built-in [t| ... |] quasi-quoter, but produces a list of types instead of a single type. Each type should be separated by a comma.

>>> [ts| Bool, (), String |]
[ConT GHC.Types.Bool,ConT GHC.Tuple.(),ConT GHC.Base.String]
>>> [ts| Maybe Int, Monad m |]
[AppT (ConT GHC.Base.Maybe) (ConT GHC.Types.Int),AppT (ConT GHC.Base.Monad) (VarT m)]