genvalidity-hspec-1.0.0.0: Standard spec's for GenValidity instances
Safe HaskellNone
LanguageHaskell2010

Test.Validity.Show

Description

Show and Read properties

Synopsis

Documentation

showReadSpec :: 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:

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

showReadRoundTrip :: forall a. (Show a, Eq a, Read a, GenValid 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 <$> genValid :: Gen Int) (const [])