{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ConstraintKinds #-}
module Test.Hspec.QuickCheck (
-- * Params
  modifyArgs
, modifyMaxSuccess
, modifyMaxDiscardRatio
, modifyMaxSize
, modifyMaxShrinks

-- * Shortcuts
, prop
, xprop
, fprop
) where

import           Test.Hspec
import           Test.QuickCheck
import           Test.Hspec.Core.QuickCheck

-- |
-- > prop ".." $
-- >   ..
--
-- is a shortcut for
--
-- @
-- `it` ".." $ `property` $
--   ..
-- @
prop :: (HasCallStack, Testable prop) => String -> prop -> Spec
prop :: forall prop.
(HasCallStack, Testable prop) =>
String -> prop -> Spec
prop String
s = forall a.
(HasCallStack, Example a) =>
String -> a -> SpecWith (Arg a)
it String
s forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall prop. Testable prop => prop -> Property
property


-- |
-- > xprop ".." $
-- >   ..
--
-- is a shortcut for
--
-- @
-- `xit` ".." $ `property` $
--   ..
-- @
xprop :: (HasCallStack, Testable prop) => String -> prop -> Spec
xprop :: forall prop.
(HasCallStack, Testable prop) =>
String -> prop -> Spec
xprop String
s = forall a.
(HasCallStack, Example a) =>
String -> a -> SpecWith (Arg a)
xit String
s forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall prop. Testable prop => prop -> Property
property


-- |
-- > fprop ".." $
-- >   ..
--
-- is a shortcut for
--
-- @
-- `fit` ".." $ `property` $
--   ..
-- @
fprop :: (HasCallStack, Testable prop) => String -> prop -> Spec
fprop :: forall prop.
(HasCallStack, Testable prop) =>
String -> prop -> Spec
fprop String
s = forall a.
(HasCallStack, Example a) =>
String -> a -> SpecWith (Arg a)
fit String
s forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall prop. Testable prop => prop -> Property
property