genvalidity-hspec-1.0.0.4: Standard spec's for GenValidity instances

Safe Haskell | None
Language | Haskell2010

Test.Validity.Shrinking

Description

Tests for Shrinking functions

You will need `TypeApplications` to use these.

Synopsis

- shrinkValidSpec :: (Show a, Eq a, Typeable a, GenValid a) => Spec
- shrinkValidSpecWithLimit :: (Show a, Eq a, Typeable a, GenValid a) => Int -> Spec
- shrinkValidPreservesValidOnGenValid :: (Show a, GenValid a) => Property
- shrinkValidPreservesValidOnGenValidWithLimit :: (Show a, GenValid a) => Int -> Property
- 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
- shrinkingPreserves :: Show a => Gen a -> (a -> [a]) -> (a -> Bool) -> Property
- shrinkValidDoesNotShrinkToItself :: (Show a, Eq a, GenValid a) => Property
- shrinkValidDoesNotShrinkToItselfWithLimit :: (Show a, Eq a, GenValid a) => Int -> Property

# Documentation

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

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

shrinkValidPreservesValidOnGenValid :: (Show a, GenValid a) => Property Source #

shrinkValidPreservesValidOnGenValidWithLimit :: (Show a, GenValid a) => Int -> Property Source #

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

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

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

shrinkValidDoesNotShrinkToItself :: (Show a, Eq a, GenValid a) => Property Source #

shrinkValidDoesNotShrinkToItselfWithLimit :: (Show a, Eq a, GenValid a) => Int -> Property Source #