genvalidity-property-0.2.1.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 (:[])

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

shrinkPreservesInvalidOnGenInvalid (:[])

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

shrinkValidPreservesValid (pure 5)

shrinkInvalidPreservesInvalid :: forall a. (Show a, GenInvalid a) => Gen a -> Property Source #

shrinkInvalidPreservesInvalid (pure (1/0) :: Gen Double)

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) (:[]) (== 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

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

shrinkDoesNotShrinkToItselfWithLimit shrinkUnchecked 100

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

shrinkDoesNotShrinkToItselfOnValid shrinkValid

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

shrinkDoesNotShrinkToItselfOnValidWithLimit shrinkValid 100

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

shrinkDoesNotShrinkToItselfOnInvalid shrinkInvalid

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

shrinkDoesNotShrinkToItselfOnInvalidWithLimit shrinkInvalid 100

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

doesNotShrinkToItself (pure 5) shrinkUnchecked

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

doesNotShrinkToItselfWithLimit (pure 5) shrinkUnchecked 100