genvalidity-hspec-1.0.0.2: Standard spec's for GenValidity instances
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.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 :: (Show a, GenValid a) => (a -> [a]) -> Property #

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

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

shrinkValidPreservesValid (pure 5 :: Gen Rational)

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

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

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

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