genvalidity-sydtest-0.0.0.0: Standard properties for functions on `Validity` types for the sydtest framework
Safe HaskellNone
LanguageHaskell2010

Test.Syd.Validity.Shrinking

Description

Tests for Shrinking functions

You will need TypeApplications to use these.

Synopsis

Documentation

shrinkValidSpec :: forall a. (Show a, Eq a, Typeable a, GenValid a) => Spec Source #

shrinkValidSpecWithLimit :: forall a. (Show a, Eq a, Typeable a, GenValid a) => Int -> Spec Source #

shrinkPreservesValidOnGenValid :: forall a. (Show a, GenValid a) => (a -> [a]) -> Property Source #

shrinkPreservesValidOnGenValid ((:[]) :: Int -> [Int])

shrinkPreservesInvalidOnGenInvalid :: forall a. (Show a, GenInvalid a) => (a -> [a]) -> Property Source #

shrinkPreservesInvalidOnGenInvalid ((:[]) :: Rational -> [Rational])

shrinkValidPreservesValid :: forall a. (Show a, GenValid a) => Gen a -> Property Source #

shrinkValidPreservesValid (pure 5 :: Gen Rational)

shrinkingStaysValid :: forall a. (Show a, Validity a) => Gen a -> (a -> [a]) -> Property Source #

shrinkingStaysValid (pure 5 :: Gen Double) (\d -> [d - 1, d - 2])

shrinkingStaysInvalid :: forall a. (Show a, Validity a) => Gen a -> (a -> [a]) -> Property Source #

shrinkingStaysInvalid (pure (1/0) :: Gen Double) (:[])

shrinkingPreserves :: forall a. Show a => Gen a -> (a -> [a]) -> (a -> Bool) -> Property Source #

shrinkingPreserves (pure 5 :: Gen Int) (:[]) (== 5)