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

Safe HaskellNone
LanguageHaskell2010

Test.Validity.Show

Description

Show and Read properties

Synopsis

Documentation

showReadSpecOnValid :: forall a. (Show a, Eq a, Read a, Typeable a, GenValid a) => Spec Source #

Standard test spec for properties of Show and Read instances for valid values

Example usage:

showReadSpecOnValid @Double

showReadSpec :: forall a. (Show a, Eq a, Read a, Typeable a, GenUnchecked a) => Spec Source #

Standard test spec for properties of Show and Read instances for unchecked values

Example usage:

showReadSpec @Int

showReadSpecOnArbitrary :: forall a. (Show a, Eq a, Read a, Typeable a, Arbitrary a) => Spec Source #

Standard test spec for properties of Show and Read instances for arbitrary values

Example usage:

showReadSpecOnArbitrary @Double

showReadSpecOnGen :: forall a. (Show a, Eq a, Read a, Typeable a) => Gen a -> String -> (a -> [a]) -> Spec Source #

Standard test spec for properties of Show and Read instances for values generated by a custom generator

Example usage:

showReadSpecOnGen ((* 2) <$> genValid @Int) "even" (const [])

showReadRoundTripOnValid :: forall a. (Show a, Eq a, Read a, GenValid a) => Property Source #

showReadRoundTripOnValid @Rational

showReadRoundTrip :: forall a. (Show a, Eq a, Read a, GenUnchecked a) => Property Source #

showReadRoundTrip @Int

showReadRoundTripOnArbitrary :: forall a. (Show a, Eq a, Read a, Arbitrary a) => Property Source #

showReadRoundTripOnArbitrary @Double

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

showReadRoundTripOnGen (abs <$> genUnchecked :: Gen Int) (const [])