Safe Haskell | Unsafe |
---|---|
Language | Haskell2010 |
Test.Expr
Description
Simple utility functions for testing.
(c) 2014-2021 Vladimír Štill
Synopsis
- testMain :: TestConfig -> Q [Dec]
- testType :: TypeOrder -> ExprName -> Q Exp
- testType' :: (Type -> Type) -> TypeOrder -> ExprName -> Q Exp
- extractOptionDef :: String -> Exp -> Q Exp
- extractOptionMaybe :: String -> Q Exp
- extractOption :: String -> Q Exp
- (<==>) :: (Eq a, Show a, NFData a) => a -> a -> Property
- cmpTeacherStudent :: (Eq a, Show a, NFData a) => a -> a -> Property
- testArgs :: Args
- runProperty :: Testable prp => Args -> prp -> IO ()
- runProperties :: Testable prp => Args -> [prp] -> IO ()
- data Args = Args {
- replay :: Maybe (QCGen, Int)
- maxSuccess :: Int
- maxDiscardRatio :: Int
- maxSize :: Int
- chatty :: Bool
- maxShrinks :: Int
- scheduleAlarm :: Int -> IO Int
- type TestAs α β = α
Test Entry
testMain :: TestConfig -> Q [Dec] #
extractOptionDef :: String -> Exp -> Q Exp #
extractOptionMaybe :: String -> Q Exp #
extractOption :: String -> Q Exp #
Test Expression Building Blocks
(<==>) :: (Eq a, Show a, NFData a) => a -> a -> Property infix 4 #
Exception aware comparison. If no exception is thrown when evaluating
either of the values, compares them using (==)
, if exception is thrown
in both, exception type is compared, otherwise if exception is thrown only
in one, property fails. Mismatching values are returned using
counterexample
on failure.
cmpTeacherStudent :: (Eq a, Show a, NFData a) => a -> a -> Property infix 4 #
runProperty :: Testable prp => Args -> prp -> IO () #
runProperties :: Testable prp => Args -> [prp] -> IO () #
Constructors
Args | |
Fields
|
Instances
scheduleAlarm :: Int -> IO Int #