genvalidity-property-0.5.0.1: Standard properties for functions on `Validity` types

Safe HaskellNone
LanguageHaskell2010

Test.Validity.Shrinking.Property

Description

Tests for shrinking functions

Synopsis

Documentation

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])

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

shrinkingStaysValidWithLimit (pure 5 :: Gen Double) (\d -> [d - 1, read "NaN"]) 1

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)

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

shrinkingPreservesWithLimit (pure 4) (:[]) 100 (== 4)

shrinkDoesNotShrinkToItself :: forall a. (Show a, Eq a, GenUnchecked a) => (a -> [a]) -> Property Source #

shrinkDoesNotShrinkToItself (shrinkUnchecked :: Double -> [Double])

shrinkDoesNotShrinkToItselfWithLimit :: forall a. (Show a, Eq a, GenUnchecked a) => (a -> [a]) -> Int -> Property Source #

shrinkDoesNotShrinkToItselfWithLimit (shrinkUnchecked :: Double -> [Double]) 100

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

shrinkDoesNotShrinkToItselfOnValid (shrinkValid ::  Rational -> [Rational])

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

shrinkDoesNotShrinkToItselfOnValidWithLimit (shrinkValid :: Rational -> [Rational]) 100

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

shrinkDoesNotShrinkToItselfOnInvalid (shrinkInvalid :: Rational -> [Rational])

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

shrinkDoesNotShrinkToItselfOnInvalidWithLimit (shrinkInvalid :: Rational -> [Rational]) 100

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

doesNotShrinkToItself (pure 5 :: Gen Double) shrinkUnchecked

doesNotShrinkToItselfWithLimit :: forall a. (Show a, Eq a) => Gen a -> (a -> [a]) -> Int -> Property Source #

doesNotShrinkToItselfWithLimit (pure 5 :: Gen Double) shrinkUnchecked 100