Safe Haskell | None |
---|---|
Language | Haskell2010 |
Test.Tasty.QuickCheck
Description
This module allows to use QuickCheck properties in tasty.
Synopsis
- testProperty :: Testable a => TestName -> a -> TestTree
- testProperties :: TestName -> [(String, Property)] -> TestTree
- newtype QuickCheckTests = QuickCheckTests Int
- data QuickCheckReplay
- = QuickCheckReplayNone
- | QuickCheckReplayLegacy Int
- | QuickCheckReplay (QCGen, Int)
- newtype QuickCheckShowReplay = QuickCheckShowReplay Bool
- newtype QuickCheckMaxSize = QuickCheckMaxSize Int
- newtype QuickCheckMaxRatio = QuickCheckMaxRatio Int
- newtype QuickCheckVerbose = QuickCheckVerbose Bool
- newtype QuickCheckMaxShrinks = QuickCheckMaxShrinks Int
- newtype QuickCheckTimeout = QuickCheckTimeout Timeout
- label :: Testable prop => String -> prop -> Property
- data Property
- pattern Success :: Int -> Int -> !(Map [String] Int) -> !(Map String Int) -> !(Map String (Map String Int)) -> String -> Result
- pattern Failure :: Int -> Int -> Int -> Int -> Int -> QCGen -> Int -> String -> Maybe AnException -> String -> [String] -> [String] -> Set String -> [Witness] -> Result
- pattern GaveUp :: Int -> Int -> !(Map [String] Int) -> !(Map String Int) -> !(Map String (Map String Int)) -> String -> Result
- pattern NoExpectedFailure :: Int -> Int -> !(Map [String] Int) -> !(Map String Int) -> !(Map String (Map String Int)) -> String -> Result
- classes :: Result -> Map String Int
- failingClasses :: Result -> Set String
- failingLabels :: Result -> [String]
- failingTestCase :: Result -> [String]
- labels :: Result -> Map [String] Int
- numDiscarded :: Result -> Int
- numShrinkFinal :: Result -> Int
- numShrinkTries :: Result -> Int
- numShrinks :: Result -> Int
- numTests :: Result -> Int
- output :: Result -> String
- reason :: Result -> String
- tables :: Result -> Map String (Map String Int)
- theException :: Result -> Maybe AnException
- usedSeed :: Result -> QCGen
- usedSize :: Result -> Int
- witnesses :: Result -> [Witness]
- (==>) :: Testable prop => Bool -> prop -> Property
- newtype NonEmptyList a = NonEmpty {
- getNonEmpty :: [a]
- monomorphic :: Name -> ExpQ
- polyQuickCheck :: Name -> ExpQ
- polyVerboseCheck :: Name -> ExpQ
- (><) :: (Gen a -> Gen a) -> (Gen a -> Gen a) -> Gen a -> Gen a
- class Arbitrary a where
- class Arbitrary1 (f :: Type -> Type) where
- liftArbitrary :: Gen a -> Gen (f a)
- liftShrink :: (a -> [a]) -> f a -> [f a]
- class Arbitrary2 (f :: Type -> Type -> Type) where
- liftArbitrary2 :: Gen a -> Gen b -> Gen (f a b)
- liftShrink2 :: (a -> [a]) -> (b -> [b]) -> f a b -> [f a b]
- class CoArbitrary a where
- coarbitrary :: a -> Gen b -> Gen b
- applyArbitrary2 :: (Arbitrary a, Arbitrary b) => (a -> b -> r) -> Gen r
- applyArbitrary3 :: (Arbitrary a, Arbitrary b, Arbitrary c) => (a -> b -> c -> r) -> Gen r
- applyArbitrary4 :: (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d) => (a -> b -> c -> d -> r) -> Gen r
- arbitrary1 :: (Arbitrary1 f, Arbitrary a) => Gen (f a)
- arbitrary2 :: (Arbitrary2 f, Arbitrary a, Arbitrary b) => Gen (f a b)
- arbitraryASCIIChar :: Gen Char
- arbitraryBoundedEnum :: (Bounded a, Enum a) => Gen a
- arbitraryBoundedIntegral :: (Bounded a, Integral a) => Gen a
- arbitraryBoundedRandom :: (Bounded a, Random a) => Gen a
- arbitraryPrintableChar :: Gen Char
- arbitrarySizedBoundedIntegral :: (Bounded a, Integral a) => Gen a
- arbitrarySizedFractional :: Fractional a => Gen a
- arbitrarySizedIntegral :: Integral a => Gen a
- arbitrarySizedNatural :: Integral a => Gen a
- arbitraryUnicodeChar :: Gen Char
- coarbitraryEnum :: Enum a => a -> Gen b -> Gen b
- coarbitraryIntegral :: Integral a => a -> Gen b -> Gen b
- coarbitraryReal :: Real a => a -> Gen b -> Gen b
- coarbitraryShow :: Show a => a -> Gen b -> Gen b
- genericCoarbitrary :: (Generic a, GCoArbitrary (Rep a)) => a -> Gen b -> Gen b
- genericShrink :: (Generic a, RecursivelyShrink (Rep a), GSubterms (Rep a) a) => a -> [a]
- infiniteList :: Arbitrary a => Gen [a]
- orderedList :: (Ord a, Arbitrary a) => Gen [a]
- recursivelyShrink :: (Generic a, RecursivelyShrink (Rep a)) => a -> [a]
- shrink1 :: (Arbitrary1 f, Arbitrary a) => f a -> [f a]
- shrink2 :: (Arbitrary2 f, Arbitrary a, Arbitrary b) => f a b -> [f a b]
- shrinkBoundedEnum :: (Bounded a, Enum a, Eq a) => a -> [a]
- shrinkDecimal :: RealFrac a => a -> [a]
- shrinkIntegral :: Integral a => a -> [a]
- shrinkList :: (a -> [a]) -> [a] -> [[a]]
- shrinkMap :: Arbitrary a => (a -> b) -> (b -> a) -> b -> [b]
- shrinkMapBy :: (a -> b) -> (b -> a) -> (a -> [a]) -> b -> [b]
- shrinkNothing :: a -> [a]
- shrinkRealFrac :: RealFrac a => a -> [a]
- subterms :: (Generic a, GSubterms (Rep a) a) => a -> [a]
- vector :: Arbitrary a => Int -> Gen [a]
- discard :: a
- labelledExamples :: Testable prop => prop -> IO ()
- labelledExamplesResult :: Testable prop => prop -> IO Result
- labelledExamplesWith :: Testable prop => Args -> prop -> IO ()
- labelledExamplesWithResult :: Testable prop => Args -> prop -> IO Result
- pattern Fn :: (a -> b) -> Fun a b
- pattern Fn2 :: (a -> b -> c) -> Fun (a, b) c
- pattern Fn3 :: (a -> b -> c -> d) -> Fun (a, b, c) d
- data Fun a b = Fun (a :-> b, b, Shrunk) (a -> b)
- class Function a where
- function :: (a -> b) -> a :-> b
- applyFun :: Fun a b -> a -> b
- applyFun2 :: Fun (a, b) c -> a -> b -> c
- applyFun3 :: Fun (a, b, c) d -> a -> b -> c -> d
- functionBoundedEnum :: (Eq a, Bounded a, Enum a) => (a -> b) -> a :-> b
- functionIntegral :: Integral a => (a -> b) -> a :-> b
- functionMap :: Function b => (a -> b) -> (b -> a) -> (a -> c) -> a :-> c
- functionRealFrac :: RealFrac a => (a -> b) -> a :-> b
- functionShow :: (Show a, Read a) => (a -> c) -> a :-> c
- functionVoid :: (forall b. void -> b) -> void :-> c
- data Gen a
- choose :: Random a => (a, a) -> Gen a
- chooseAny :: Random a => Gen a
- chooseBoundedIntegral :: (Bounded a, Integral a) => (a, a) -> Gen a
- chooseEnum :: Enum a => (a, a) -> Gen a
- chooseInt :: (Int, Int) -> Gen Int
- chooseInteger :: (Integer, Integer) -> Gen Integer
- elements :: HasCallStack => [a] -> Gen a
- frequency :: HasCallStack => [(Int, Gen a)] -> Gen a
- generate :: Gen a -> IO a
- getSize :: Gen Int
- growingElements :: HasCallStack => [a] -> Gen a
- infiniteListOf :: Gen a -> Gen [a]
- listOf :: Gen a -> Gen [a]
- listOf1 :: Gen a -> Gen [a]
- oneof :: HasCallStack => [Gen a] -> Gen a
- resize :: HasCallStack => Int -> Gen a -> Gen a
- sample :: Show a => Gen a -> IO ()
- sample' :: Gen a -> IO [a]
- scale :: (Int -> Int) -> Gen a -> Gen a
- shuffle :: [a] -> Gen [a]
- sized :: (Int -> Gen a) -> Gen a
- sublistOf :: [a] -> Gen [a]
- suchThat :: Gen a -> (a -> Bool) -> Gen a
- suchThatMap :: Gen a -> (a -> Maybe b) -> Gen b
- suchThatMaybe :: Gen a -> (a -> Bool) -> Gen (Maybe a)
- variant :: Integral n => n -> Gen a -> Gen a
- vectorOf :: Int -> Gen a -> Gen [a]
- newtype ASCIIString = ASCIIString {
- getASCIIString :: String
- newtype Blind a = Blind {
- getBlind :: a
- newtype Fixed a = Fixed {
- getFixed :: a
- data InfiniteList a = InfiniteList {
- getInfiniteList :: [a]
- infiniteListInternalData :: InfiniteListInternalData a
- newtype Large a = Large {
- getLarge :: a
- newtype Negative a = Negative {
- getNegative :: a
- newtype NonNegative a = NonNegative {
- getNonNegative :: a
- newtype NonPositive a = NonPositive {
- getNonPositive :: a
- newtype NonZero a = NonZero {
- getNonZero :: a
- newtype OrderedList a = Ordered {
- getOrdered :: [a]
- newtype Positive a = Positive {
- getPositive :: a
- newtype PrintableString = PrintableString {
- getPrintableString :: String
- newtype Shrink2 a = Shrink2 {
- getShrink2 :: a
- class ShrinkState s a where
- shrinkInit :: a -> s
- shrinkState :: a -> s -> [(a, s)]
- data Shrinking s a = Shrinking s a
- newtype Small a = Small {
- getSmall :: a
- data Smart a = Smart Int a
- newtype SortedList a = Sorted {
- getSorted :: [a]
- newtype UnicodeString = UnicodeString {
- getUnicodeString :: String
- (.&&.) :: (Testable prop1, Testable prop2) => prop1 -> prop2 -> Property
- (.&.) :: (Testable prop1, Testable prop2) => prop1 -> prop2 -> Property
- (.||.) :: (Testable prop1, Testable prop2) => prop1 -> prop2 -> Property
- (=/=) :: (Eq a, Show a) => a -> a -> Property
- (===) :: (Eq a, Show a) => a -> a -> Property
- data Discard = Discard
- class Testable prop where
- property :: prop -> Property
- propertyForAllShrinkShow :: Gen a -> (a -> [a]) -> (a -> [String]) -> (a -> prop) -> Property
- data Witness = (Typeable a, Show a) => Wit a
- again :: Testable prop => prop -> Property
- castWitness :: Typeable a => Witness -> Maybe a
- checkCoverage :: Testable prop => prop -> Property
- checkCoverageWith :: Testable prop => Confidence -> prop -> Property
- classify :: Testable prop => Bool -> String -> prop -> Property
- coerceWitness :: Typeable a => Witness -> a
- collect :: (Show a, Testable prop) => a -> prop -> Property
- conjoin :: Testable prop => [prop] -> Property
- counterexample :: Testable prop => String -> prop -> Property
- cover :: Testable prop => Double -> Bool -> String -> prop -> Property
- coverTable :: Testable prop => String -> [(String, Double)] -> prop -> Property
- discardAfter :: Testable prop => Int -> prop -> Property
- disjoin :: Testable prop => [prop] -> Property
- expectFailure :: Testable prop => prop -> Property
- forAll :: (Show a, Testable prop) => Gen a -> (a -> prop) -> Property
- forAllBlind :: Testable prop => Gen a -> (a -> prop) -> Property
- forAllShow :: Testable prop => Gen a -> (a -> String) -> (a -> prop) -> Property
- forAllShrink :: (Show a, Testable prop) => Gen a -> (a -> [a]) -> (a -> prop) -> Property
- forAllShrinkBlind :: Testable prop => Gen a -> (a -> [a]) -> (a -> prop) -> Property
- forAllShrinkShow :: Testable prop => Gen a -> (a -> [a]) -> (a -> String) -> (a -> prop) -> Property
- idempotentIOProperty :: Testable prop => IO prop -> Property
- ioProperty :: Testable prop => IO prop -> Property
- mapSize :: Testable prop => (Int -> Int) -> prop -> Property
- noShrinking :: Testable prop => prop -> Property
- once :: Testable prop => prop -> Property
- printTestCase :: Testable prop => String -> prop -> Property
- shrinking :: Testable prop => (a -> [a]) -> a -> (a -> prop) -> Property
- stdConfidence :: Confidence
- tabulate :: Testable prop => String -> [String] -> prop -> Property
- total :: NFData a => a -> Property
- verboseShrinking :: Testable prop => prop -> Property
- whenFail :: Testable prop => IO () -> prop -> Property
- whenFail' :: Testable prop => IO () -> prop -> Property
- withDiscardRatio :: Testable prop => Int -> prop -> Property
- withMaxShrinks :: Testable prop => Int -> prop -> Property
- withMaxSize :: Testable prop => Int -> prop -> Property
- withMaxSuccess :: Testable prop => Int -> prop -> Property
- within :: Testable prop => Int -> prop -> Property
- witness :: (Typeable a, Show a, Testable prop) => a -> prop -> Property
- data Confidence = Confidence {}
- isSuccess :: Result -> Bool
- recheck :: Testable prop => Result -> prop -> IO ()
- newtype QC = QC Property
- optionSetToArgs :: OptionSet -> IO (Int, Args)
Documentation
testProperty :: Testable a => TestName -> a -> TestTree Source #
Create a TestTree
for a QuickCheck Testable
property
testProperties :: TestName -> [(String, Property)] -> TestTree Source #
Create a test from a list of QuickCheck properties. To be used
with allProperties
. E.g.
tests :: TestTree tests = testProperties "Foo" $allProperties
newtype QuickCheckTests Source #
Number of test cases for QuickCheck to generate
Constructors
QuickCheckTests Int |
Instances
data QuickCheckReplay Source #
Replay seed
Constructors
QuickCheckReplayNone | No seed Since: 0.11 |
QuickCheckReplayLegacy Int | Legacy integer seed Since: 0.11 |
QuickCheckReplay (QCGen, Int) |
Since: 0.11 |
Instances
IsOption QuickCheckReplay Source # | |
Defined in Test.Tasty.QuickCheck Methods defaultValue :: QuickCheckReplay parseValue :: String -> Maybe QuickCheckReplay optionName :: Tagged QuickCheckReplay String optionHelp :: Tagged QuickCheckReplay String showDefaultValue :: QuickCheckReplay -> Maybe String optionCLParser :: Parser QuickCheckReplay |
newtype QuickCheckShowReplay Source #
If a test case fails unexpectedly, show the replay token
Constructors
QuickCheckShowReplay Bool |
Instances
IsOption QuickCheckShowReplay Source # | |
Defined in Test.Tasty.QuickCheck Methods defaultValue :: QuickCheckShowReplay parseValue :: String -> Maybe QuickCheckShowReplay optionName :: Tagged QuickCheckShowReplay String optionHelp :: Tagged QuickCheckShowReplay String showDefaultValue :: QuickCheckShowReplay -> Maybe String optionCLParser :: Parser QuickCheckShowReplay |
newtype QuickCheckMaxSize Source #
Size of the biggest test cases
Constructors
QuickCheckMaxSize Int |
Instances
newtype QuickCheckMaxRatio Source #
Maximum number of of discarded tests per successful test before giving up.
Constructors
QuickCheckMaxRatio Int |
Instances
newtype QuickCheckVerbose Source #
Show the test cases that QuickCheck generates
Constructors
QuickCheckVerbose Bool |
Instances
IsOption QuickCheckVerbose Source # | |
Defined in Test.Tasty.QuickCheck Methods defaultValue :: QuickCheckVerbose parseValue :: String -> Maybe QuickCheckVerbose optionName :: Tagged QuickCheckVerbose String optionHelp :: Tagged QuickCheckVerbose String showDefaultValue :: QuickCheckVerbose -> Maybe String optionCLParser :: Parser QuickCheckVerbose |
newtype QuickCheckMaxShrinks Source #
Number of shrinks allowed before QuickCheck will fail a test.
Since: 0.10.2
Constructors
QuickCheckMaxShrinks Int |
Instances
newtype QuickCheckTimeout Source #
Timeout for individual tests within a property.
Since: 0.11.1
Constructors
QuickCheckTimeout Timeout |
Instances
Eq QuickCheckTimeout Source # | |
Defined in Test.Tasty.QuickCheck Methods (==) :: QuickCheckTimeout -> QuickCheckTimeout -> Bool (/=) :: QuickCheckTimeout -> QuickCheckTimeout -> Bool | |
Ord QuickCheckTimeout Source # | |
Defined in Test.Tasty.QuickCheck Methods compare :: QuickCheckTimeout -> QuickCheckTimeout -> Ordering (<) :: QuickCheckTimeout -> QuickCheckTimeout -> Bool (<=) :: QuickCheckTimeout -> QuickCheckTimeout -> Bool (>) :: QuickCheckTimeout -> QuickCheckTimeout -> Bool (>=) :: QuickCheckTimeout -> QuickCheckTimeout -> Bool max :: QuickCheckTimeout -> QuickCheckTimeout -> QuickCheckTimeout min :: QuickCheckTimeout -> QuickCheckTimeout -> QuickCheckTimeout | |
IsOption QuickCheckTimeout Source # | |
Defined in Test.Tasty.QuickCheck Methods defaultValue :: QuickCheckTimeout parseValue :: String -> Maybe QuickCheckTimeout optionName :: Tagged QuickCheckTimeout String optionHelp :: Tagged QuickCheckTimeout String showDefaultValue :: QuickCheckTimeout -> Maybe String optionCLParser :: Parser QuickCheckTimeout |
Re-export of Test.QuickCheck
pattern Success :: Int -> Int -> !(Map [String] Int) -> !(Map String Int) -> !(Map String (Map String Int)) -> String -> Result #
pattern Failure :: Int -> Int -> Int -> Int -> Int -> QCGen -> Int -> String -> Maybe AnException -> String -> [String] -> [String] -> Set String -> [Witness] -> Result #
pattern GaveUp :: Int -> Int -> !(Map [String] Int) -> !(Map String Int) -> !(Map String (Map String Int)) -> String -> Result #
pattern NoExpectedFailure :: Int -> Int -> !(Map [String] Int) -> !(Map String Int) -> !(Map String (Map String Int)) -> String -> Result #
failingClasses :: Result -> Set String #
failingLabels :: Result -> [String] #
failingTestCase :: Result -> [String] #
numDiscarded :: Result -> Int #
numShrinkFinal :: Result -> Int #
numShrinkTries :: Result -> Int #
numShrinks :: Result -> Int #
theException :: Result -> Maybe AnException #
newtype NonEmptyList a #
Constructors
NonEmpty | |
Fields
|
Instances
monomorphic :: Name -> ExpQ #
polyQuickCheck :: Name -> ExpQ #
polyVerboseCheck :: Name -> ExpQ #
Minimal complete definition
Instances
class Arbitrary1 (f :: Type -> Type) where #
Minimal complete definition
Instances
Arbitrary1 IntMap | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary :: Gen a -> Gen (IntMap a) # liftShrink :: (a -> [a]) -> IntMap a -> [IntMap a] # | |
Arbitrary1 Seq | |
Defined in Test.QuickCheck.Arbitrary | |
Arbitrary1 Tree | |
Defined in Test.QuickCheck.Arbitrary | |
Arbitrary1 Identity | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary :: Gen a -> Gen (Identity a) # liftShrink :: (a -> [a]) -> Identity a -> [Identity a] # | |
Arbitrary1 ZipList | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary :: Gen a -> Gen (ZipList a) # liftShrink :: (a -> [a]) -> ZipList a -> [ZipList a] # | |
Arbitrary1 Maybe | |
Defined in Test.QuickCheck.Arbitrary | |
Arbitrary1 [] | |
Defined in Test.QuickCheck.Arbitrary | |
(Ord k, Arbitrary k) => Arbitrary1 (Map k) | |
Defined in Test.QuickCheck.Arbitrary | |
Arbitrary a => Arbitrary1 (Either a) | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary :: Gen a0 -> Gen (Either a a0) # liftShrink :: (a0 -> [a0]) -> Either a a0 -> [Either a a0] # | |
Arbitrary a => Arbitrary1 ((,) a) | |
Defined in Test.QuickCheck.Arbitrary | |
Arbitrary a => Arbitrary1 (Const a :: Type -> Type) | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary :: Gen a0 -> Gen (Const a a0) # liftShrink :: (a0 -> [a0]) -> Const a a0 -> [Const a a0] # | |
Arbitrary a => Arbitrary1 (Constant a :: Type -> Type) | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary :: Gen a0 -> Gen (Constant a a0) # liftShrink :: (a0 -> [a0]) -> Constant a a0 -> [Constant a a0] # | |
(Arbitrary1 f, Arbitrary1 g) => Arbitrary1 (Product f g) | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary :: Gen a -> Gen (Product f g a) # liftShrink :: (a -> [a]) -> Product f g a -> [Product f g a] # | |
CoArbitrary a => Arbitrary1 ((->) a) | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary :: Gen a0 -> Gen (a -> a0) # liftShrink :: (a0 -> [a0]) -> (a -> a0) -> [a -> a0] # | |
(Arbitrary1 f, Arbitrary1 g) => Arbitrary1 (Compose f g) | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary :: Gen a -> Gen (Compose f g a) # liftShrink :: (a -> [a]) -> Compose f g a -> [Compose f g a] # |
class Arbitrary2 (f :: Type -> Type -> Type) where #
Minimal complete definition
Methods
liftArbitrary2 :: Gen a -> Gen b -> Gen (f a b) #
liftShrink2 :: (a -> [a]) -> (b -> [b]) -> f a b -> [f a b] #
Instances
Arbitrary2 Either | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary2 :: Gen a -> Gen b -> Gen (Either a b) # liftShrink2 :: (a -> [a]) -> (b -> [b]) -> Either a b -> [Either a b] # | |
Arbitrary2 (,) | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary2 :: Gen a -> Gen b -> Gen (a, b) # liftShrink2 :: (a -> [a]) -> (b -> [b]) -> (a, b) -> [(a, b)] # | |
Arbitrary2 (Const :: Type -> Type -> Type) | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary2 :: Gen a -> Gen b -> Gen (Const a b) # liftShrink2 :: (a -> [a]) -> (b -> [b]) -> Const a b -> [Const a b] # | |
Arbitrary2 (Constant :: Type -> Type -> Type) | |
Defined in Test.QuickCheck.Arbitrary Methods liftArbitrary2 :: Gen a -> Gen b -> Gen (Constant a b) # liftShrink2 :: (a -> [a]) -> (b -> [b]) -> Constant a b -> [Constant a b] # |
class CoArbitrary a where #
Minimal complete definition
Nothing
Methods
coarbitrary :: a -> Gen b -> Gen b #
Instances
applyArbitrary2 :: (Arbitrary a, Arbitrary b) => (a -> b -> r) -> Gen r #
applyArbitrary4 :: (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d) => (a -> b -> c -> d -> r) -> Gen r #
arbitrary1 :: (Arbitrary1 f, Arbitrary a) => Gen (f a) #
arbitrary2 :: (Arbitrary2 f, Arbitrary a, Arbitrary b) => Gen (f a b) #
arbitraryASCIIChar :: Gen Char #
arbitraryBoundedEnum :: (Bounded a, Enum a) => Gen a #
arbitraryBoundedIntegral :: (Bounded a, Integral a) => Gen a #
arbitraryBoundedRandom :: (Bounded a, Random a) => Gen a #
arbitraryPrintableChar :: Gen Char #
arbitrarySizedBoundedIntegral :: (Bounded a, Integral a) => Gen a #
arbitrarySizedFractional :: Fractional a => Gen a #
arbitrarySizedIntegral :: Integral a => Gen a #
arbitrarySizedNatural :: Integral a => Gen a #
arbitraryUnicodeChar :: Gen Char #
coarbitraryEnum :: Enum a => a -> Gen b -> Gen b #
coarbitraryIntegral :: Integral a => a -> Gen b -> Gen b #
coarbitraryReal :: Real a => a -> Gen b -> Gen b #
coarbitraryShow :: Show a => a -> Gen b -> Gen b #
genericCoarbitrary :: (Generic a, GCoArbitrary (Rep a)) => a -> Gen b -> Gen b #
genericShrink :: (Generic a, RecursivelyShrink (Rep a), GSubterms (Rep a) a) => a -> [a] #
infiniteList :: Arbitrary a => Gen [a] #
orderedList :: (Ord a, Arbitrary a) => Gen [a] #
recursivelyShrink :: (Generic a, RecursivelyShrink (Rep a)) => a -> [a] #
shrink1 :: (Arbitrary1 f, Arbitrary a) => f a -> [f a] #
shrink2 :: (Arbitrary2 f, Arbitrary a, Arbitrary b) => f a b -> [f a b] #
shrinkBoundedEnum :: (Bounded a, Enum a, Eq a) => a -> [a] #
shrinkDecimal :: RealFrac a => a -> [a] #
shrinkIntegral :: Integral a => a -> [a] #
shrinkList :: (a -> [a]) -> [a] -> [[a]] #
shrinkMapBy :: (a -> b) -> (b -> a) -> (a -> [a]) -> b -> [b] #
shrinkNothing :: a -> [a] #
shrinkRealFrac :: RealFrac a => a -> [a] #
labelledExamples :: Testable prop => prop -> IO () #
labelledExamplesResult :: Testable prop => prop -> IO Result #
labelledExamplesWith :: Testable prop => Args -> prop -> IO () #
labelledExamplesWithResult :: Testable prop => Args -> prop -> IO Result #
Constructors
Fun (a :-> b, b, Shrunk) (a -> b) |
Minimal complete definition
Nothing
Instances
functionBoundedEnum :: (Eq a, Bounded a, Enum a) => (a -> b) -> a :-> b #
functionIntegral :: Integral a => (a -> b) -> a :-> b #
functionMap :: Function b => (a -> b) -> (b -> a) -> (a -> c) -> a :-> c #
functionRealFrac :: RealFrac a => (a -> b) -> a :-> b #
functionShow :: (Show a, Read a) => (a -> c) -> a :-> c #
functionVoid :: (forall b. void -> b) -> void :-> c #
Instances
Applicative Gen | |
Functor Gen | |
Monad Gen | |
MonadFix Gen | |
Defined in Test.QuickCheck.Gen | |
Testable prop => Testable (Gen prop) | |
Defined in Test.QuickCheck.Property |
chooseBoundedIntegral :: (Bounded a, Integral a) => (a, a) -> Gen a #
chooseEnum :: Enum a => (a, a) -> Gen a #
chooseInteger :: (Integer, Integer) -> Gen Integer #
growingElements :: HasCallStack => [a] -> Gen a #
infiniteListOf :: Gen a -> Gen [a] #
suchThatMap :: Gen a -> (a -> Maybe b) -> Gen b #
suchThatMaybe :: Gen a -> (a -> Bool) -> Gen (Maybe a) #
newtype ASCIIString #
Constructors
ASCIIString | |
Fields
|
Instances
Arbitrary ASCIIString | |
Defined in Test.QuickCheck.Modifiers | |
Read ASCIIString | |
Defined in Test.QuickCheck.Modifiers Methods readsPrec :: Int -> ReadS ASCIIString readList :: ReadS [ASCIIString] readPrec :: ReadPrec ASCIIString readListPrec :: ReadPrec [ASCIIString] | |
Show ASCIIString | |
Defined in Test.QuickCheck.Modifiers Methods showsPrec :: Int -> ASCIIString -> ShowS show :: ASCIIString -> String showList :: [ASCIIString] -> ShowS | |
Eq ASCIIString | |
Defined in Test.QuickCheck.Modifiers | |
Ord ASCIIString | |
Defined in Test.QuickCheck.Modifiers Methods compare :: ASCIIString -> ASCIIString -> Ordering (<) :: ASCIIString -> ASCIIString -> Bool (<=) :: ASCIIString -> ASCIIString -> Bool (>) :: ASCIIString -> ASCIIString -> Bool (>=) :: ASCIIString -> ASCIIString -> Bool max :: ASCIIString -> ASCIIString -> ASCIIString min :: ASCIIString -> ASCIIString -> ASCIIString |
Instances
Functor Blind | |
Arbitrary a => Arbitrary (Blind a) | |
Enum a => Enum (Blind a) | |
Defined in Test.QuickCheck.Modifiers | |
Num a => Num (Blind a) | |
Integral a => Integral (Blind a) | |
Defined in Test.QuickCheck.Modifiers | |
Real a => Real (Blind a) | |
Defined in Test.QuickCheck.Modifiers Methods toRational :: Blind a -> Rational | |
Show (Blind a) | |
Eq a => Eq (Blind a) | |
Ord a => Ord (Blind a) | |
Instances
Functor Fixed | |
Arbitrary a => Arbitrary (Fixed a) | |
Enum a => Enum (Fixed a) | |
Defined in Test.QuickCheck.Modifiers | |
Num a => Num (Fixed a) | |
Read a => Read (Fixed a) | |
Defined in Test.QuickCheck.Modifiers | |
Integral a => Integral (Fixed a) | |
Defined in Test.QuickCheck.Modifiers | |
Real a => Real (Fixed a) | |
Defined in Test.QuickCheck.Modifiers Methods toRational :: Fixed a -> Rational | |
Show a => Show (Fixed a) | |
Eq a => Eq (Fixed a) | |
Ord a => Ord (Fixed a) | |
data InfiniteList a #
Constructors
InfiniteList | |
Fields
|
Instances
Arbitrary a => Arbitrary (InfiniteList a) | |
Defined in Test.QuickCheck.Modifiers | |
Show a => Show (InfiniteList a) | |
Defined in Test.QuickCheck.Modifiers Methods showsPrec :: Int -> InfiniteList a -> ShowS show :: InfiniteList a -> String showList :: [InfiniteList a] -> ShowS |
Instances
Functor Large | |
(Integral a, Bounded a) => Arbitrary (Large a) | |
Enum a => Enum (Large a) | |
Defined in Test.QuickCheck.Modifiers | |
Ix a => Ix (Large a) | |
Defined in Test.QuickCheck.Modifiers | |
Num a => Num (Large a) | |
Read a => Read (Large a) | |
Defined in Test.QuickCheck.Modifiers | |
Integral a => Integral (Large a) | |
Defined in Test.QuickCheck.Modifiers | |
Real a => Real (Large a) | |
Defined in Test.QuickCheck.Modifiers Methods toRational :: Large a -> Rational | |
Show a => Show (Large a) | |
Eq a => Eq (Large a) | |
Ord a => Ord (Large a) | |
Constructors
Negative | |
Fields
|
Instances
Functor Negative | |
(Num a, Ord a, Arbitrary a) => Arbitrary (Negative a) | |
Enum a => Enum (Negative a) | |
Defined in Test.QuickCheck.Modifiers | |
Read a => Read (Negative a) | |
Defined in Test.QuickCheck.Modifiers | |
Show a => Show (Negative a) | |
Eq a => Eq (Negative a) | |
Ord a => Ord (Negative a) | |
newtype NonNegative a #
Constructors
NonNegative | |
Fields
|
Instances
newtype NonPositive a #
Constructors
NonPositive | |
Fields
|
Instances
Constructors
NonZero | |
Fields
|
Instances
Functor NonZero | |
(Num a, Eq a, Arbitrary a) => Arbitrary (NonZero a) | |
Enum a => Enum (NonZero a) | |
Defined in Test.QuickCheck.Modifiers | |
Read a => Read (NonZero a) | |
Defined in Test.QuickCheck.Modifiers | |
Show a => Show (NonZero a) | |
Eq a => Eq (NonZero a) | |
Ord a => Ord (NonZero a) | |
Defined in Test.QuickCheck.Modifiers |
newtype OrderedList a #
Constructors
Ordered | |
Fields
|
Instances
Constructors
Positive | |
Fields
|
Instances
Functor Positive | |
(Num a, Ord a, Arbitrary a) => Arbitrary (Positive a) | |
Enum a => Enum (Positive a) | |
Defined in Test.QuickCheck.Modifiers | |
Read a => Read (Positive a) | |
Defined in Test.QuickCheck.Modifiers | |
Show a => Show (Positive a) | |
Eq a => Eq (Positive a) | |
Ord a => Ord (Positive a) | |
newtype PrintableString #
Constructors
PrintableString | |
Fields
|
Instances
Constructors
Shrink2 | |
Fields
|
Instances
Functor Shrink2 | |
Arbitrary a => Arbitrary (Shrink2 a) | |
Enum a => Enum (Shrink2 a) | |
Defined in Test.QuickCheck.Modifiers | |
Num a => Num (Shrink2 a) | |
Read a => Read (Shrink2 a) | |
Defined in Test.QuickCheck.Modifiers | |
Integral a => Integral (Shrink2 a) | |
Defined in Test.QuickCheck.Modifiers | |
Real a => Real (Shrink2 a) | |
Defined in Test.QuickCheck.Modifiers Methods toRational :: Shrink2 a -> Rational | |
Show a => Show (Shrink2 a) | |
Eq a => Eq (Shrink2 a) | |
Ord a => Ord (Shrink2 a) | |
Defined in Test.QuickCheck.Modifiers |
class ShrinkState s a where #
Constructors
Shrinking s a |
Instances
Functor Small | |
Integral a => Arbitrary (Small a) | |
Enum a => Enum (Small a) | |
Defined in Test.QuickCheck.Modifiers | |
Ix a => Ix (Small a) | |
Defined in Test.QuickCheck.Modifiers | |
Num a => Num (Small a) | |
Read a => Read (Small a) | |
Defined in Test.QuickCheck.Modifiers | |
Integral a => Integral (Small a) | |
Defined in Test.QuickCheck.Modifiers | |
Real a => Real (Small a) | |
Defined in Test.QuickCheck.Modifiers Methods toRational :: Small a -> Rational | |
Show a => Show (Small a) | |
Eq a => Eq (Small a) | |
Ord a => Ord (Small a) | |
Constructors
Smart Int a |
newtype SortedList a #
Instances
newtype UnicodeString #
Constructors
UnicodeString | |
Fields
|
Instances
Arbitrary UnicodeString | |
Defined in Test.QuickCheck.Modifiers | |
Read UnicodeString | |
Defined in Test.QuickCheck.Modifiers Methods readsPrec :: Int -> ReadS UnicodeString readList :: ReadS [UnicodeString] readPrec :: ReadPrec UnicodeString readListPrec :: ReadPrec [UnicodeString] | |
Show UnicodeString | |
Defined in Test.QuickCheck.Modifiers Methods showsPrec :: Int -> UnicodeString -> ShowS show :: UnicodeString -> String showList :: [UnicodeString] -> ShowS | |
Eq UnicodeString | |
Defined in Test.QuickCheck.Modifiers | |
Ord UnicodeString | |
Defined in Test.QuickCheck.Modifiers Methods compare :: UnicodeString -> UnicodeString -> Ordering (<) :: UnicodeString -> UnicodeString -> Bool (<=) :: UnicodeString -> UnicodeString -> Bool (>) :: UnicodeString -> UnicodeString -> Bool (>=) :: UnicodeString -> UnicodeString -> Bool max :: UnicodeString -> UnicodeString -> UnicodeString min :: UnicodeString -> UnicodeString -> UnicodeString |
Constructors
Discard |
Minimal complete definition
Methods
property :: prop -> Property #
propertyForAllShrinkShow :: Gen a -> (a -> [a]) -> (a -> [String]) -> (a -> prop) -> Property #
Instances
Testable Discard | |
Defined in Test.QuickCheck.Property | |
Testable Prop | |
Defined in Test.QuickCheck.Property | |
Testable Property | |
Defined in Test.QuickCheck.Property | |
Testable Result | |
Defined in Test.QuickCheck.Property | |
Testable () | |
Defined in Test.QuickCheck.Property | |
Testable Bool | |
Defined in Test.QuickCheck.Property | |
Testable prop => Testable (Gen prop) | |
Defined in Test.QuickCheck.Property | |
Testable prop => Testable (Maybe prop) | |
Defined in Test.QuickCheck.Property | |
(Arbitrary a, Show a, Testable prop) => Testable (a -> prop) | |
Defined in Test.QuickCheck.Property |
Constructors
(Typeable a, Show a) => Wit a |
castWitness :: Typeable a => Witness -> Maybe a #
checkCoverage :: Testable prop => prop -> Property #
checkCoverageWith :: Testable prop => Confidence -> prop -> Property #
coerceWitness :: Typeable a => Witness -> a #
counterexample :: Testable prop => String -> prop -> Property #
coverTable :: Testable prop => String -> [(String, Double)] -> prop -> Property #
discardAfter :: Testable prop => Int -> prop -> Property #
expectFailure :: Testable prop => prop -> Property #
forAllBlind :: Testable prop => Gen a -> (a -> prop) -> Property #
forAllShow :: Testable prop => Gen a -> (a -> String) -> (a -> prop) -> Property #
forAllShrink :: (Show a, Testable prop) => Gen a -> (a -> [a]) -> (a -> prop) -> Property #
forAllShrinkBlind :: Testable prop => Gen a -> (a -> [a]) -> (a -> prop) -> Property #
forAllShrinkShow :: Testable prop => Gen a -> (a -> [a]) -> (a -> String) -> (a -> prop) -> Property #
idempotentIOProperty :: Testable prop => IO prop -> Property #
ioProperty :: Testable prop => IO prop -> Property #
noShrinking :: Testable prop => prop -> Property #
printTestCase :: Testable prop => String -> prop -> Property #
verboseShrinking :: Testable prop => prop -> Property #
withDiscardRatio :: Testable prop => Int -> prop -> Property #
withMaxShrinks :: Testable prop => Int -> prop -> Property #
withMaxSize :: Testable prop => Int -> prop -> Property #
withMaxSuccess :: Testable prop => Int -> prop -> Property #
data Confidence #
Constructors
Confidence | |
Instances
Show Confidence | |
Defined in Test.QuickCheck.State Methods showsPrec :: Int -> Confidence -> ShowS show :: Confidence -> String showList :: [Confidence] -> ShowS |
Internal
If you are building a test suite, you don't need these functions.
They may be used by other tasty add-on packages (such as tasty-hspec).
Instances
IsTest QC Source # | |
Defined in Test.Tasty.QuickCheck Methods run :: OptionSet -> QC -> (Progress -> IO ()) -> IO Result testOptions :: Tagged QC [OptionDescription] |
optionSetToArgs :: OptionSet -> IO (Int, Args) Source #
Convert tasty options into QuickCheck options.
This is a low-level function that was originally added for tasty-hspec but may be used by others.
The returned Int is kept only for backward compatibility purposes. It
has no use in tasty-quickcheck
.
Since: 0.9.1