Safe Haskell | None |
---|
Unittest helpers for TemplateHaskell components.
- propPrefix :: String
- casePrefix :: String
- simplifyName :: String -> String -> String
- runProp :: Testable prop => String -> prop -> Test
- runCase :: String -> Assertion -> Test
- run :: Name -> Q Exp
- mapSlashes :: String -> String
- testSuite :: String -> [Name] -> Q [Dec]
- mkConsArbitrary :: (Name, [a]) -> Exp
- conInfo :: Con -> (Name, [Type])
- mkRegularArbitrary :: Name -> [Con] -> Q [Dec]
- genArbitrary :: Name -> Q [Dec]
Documentation
propPrefix :: StringSource
casePrefix :: StringSource
simplifyName :: String -> String -> StringSource
mapSlashes :: String -> StringSource
mkConsArbitrary :: (Name, [a]) -> ExpSource
mkRegularArbitrary :: Name -> [Con] -> Q [Dec]Source
genArbitrary :: Name -> Q [Dec]Source
Builds a default Arbitrary instance for a type. This requires that all members are of types that already have Arbitrary instances, and that the arbitrary instances are well behaved (w.r.t. recursive data structures, or similar concerns). In that sense, this is not appropriate for all data types, just those that are simple but very repetitive or have many simple fields.