genvalidity-hspec-hashable-1.0.0.1: Standard spec's for Hashable instances
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Validity.Hashable

Description

Hashable properties

You will need TypeApplications to use these.

Synopsis

Documentation

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

Standard test spec for properties of Hashable instances for valid values

Example usage:

hashableSpec @Int

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

Standard test spec for properties of Hashable instances for arbitrary values

Example usage:

hashableSpecOnArbitrary @Int

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

Standard test spec for properties of Hashable instances for values generated by a given generator (and name for that generator).

Example usage:

hashableSpecOnGen ((* 2) <$> genValid @Int) "even"