{-# OPTIONS_GHC -fno-warn-tabs #-}
{-|
Module      : Test.Hspec.Variant
Description : Variant property spec
Copyright   : (c) Jorge Santiago Alvarez Cuadros, 2015
License     : GPL-3
Maintainer  : sanjorgek@ciencias.unam.mx
Stability   : experimental
Portability : portable

To test "invalid" and "valid" properties
-}
module Test.Hspec.Variant where
import Test.Hspec
import Test.QuickCheck.Variant

-- |Is a shorcut for
-- > it ".." $ propertyValid $ ..
propValid :: (VarTestable prop) => String -> prop -> Spec
propValid :: String -> prop -> Spec
propValid String
s = String -> Property -> SpecWith (Arg Property)
forall a.
(HasCallStack, Example a) =>
String -> a -> SpecWith (Arg a)
it String
s (Property -> Spec) -> (prop -> Property) -> prop -> Spec
forall b c a. (b -> c) -> (a -> b) -> a -> c
. prop -> Property
forall prop. VarTestable prop => prop -> Property
propertyValid

-- |Is a shorcut for
-- > it ".." $ propertyInvalid $ ..
propInvalid :: (VarTestable prop) => String -> prop -> Spec
propInvalid :: String -> prop -> Spec
propInvalid String
s = String -> Property -> SpecWith (Arg Property)
forall a.
(HasCallStack, Example a) =>
String -> a -> SpecWith (Arg a)
it String
s (Property -> Spec) -> (prop -> Property) -> prop -> Spec
forall b c a. (b -> c) -> (a -> b) -> a -> c
. prop -> Property
forall prop. VarTestable prop => prop -> Property
propertyInvalid