genvalidity-property-0.2.0.0: 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])

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)