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

Safe Haskell | None
Language | Haskell2010

Test.Validity.Shrinking.Property

Description

Tests for shrinking functions

Synopsis

- shrinkPreservesValidOnGenValid :: (Show a, GenValid a) => (a -> [a]) -> Property
- shrinkValidPreservesValid :: (Show a, GenValid a) => Gen a -> Property
- shrinkingStaysValid :: (Show a, Validity a) => Gen a -> (a -> [a]) -> Property
- shrinkingStaysValidWithLimit :: (Show a, Validity a) => Gen a -> (a -> [a]) -> Int -> Property
- shrinkingPreserves :: Show a => Gen a -> (a -> [a]) -> (a -> Bool) -> Property
- shrinkingPreservesWithLimit :: Show a => Gen a -> (a -> [a]) -> Int -> (a -> Bool) -> Property
- shrinkDoesNotShrinkToItself :: (Show a, Eq a, GenValid a) => (a -> [a]) -> Property
- shrinkDoesNotShrinkToItselfWithLimit :: (Show a, Eq a, GenValid a) => (a -> [a]) -> Int -> Property
- shrinkDoesNotShrinkToItselfOnValid :: (Show a, Eq a, GenValid a) => (a -> [a]) -> Property
- shrinkDoesNotShrinkToItselfOnValidWithLimit :: (Show a, Eq a, GenValid a) => (a -> [a]) -> Int -> Property
- doesNotShrinkToItself :: (Show a, Eq a) => Gen a -> (a -> [a]) -> Property
- doesNotShrinkToItselfWithLimit :: (Show a, Eq a) => Gen a -> (a -> [a]) -> Int -> Property

# Documentation

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

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

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

    shrinkValidPreservesValid (pure 5 :: Gen Rational)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    doesNotShrinkToItself (pure 5 :: Gen Double) shrinkValid

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

    doesNotShrinkToItselfWithLimit (pure 5 :: Gen Double) shrinkValid 100