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

Safe Haskell | None
Language | Haskell2010

Test.Validity.Ord

Description

Ord properties

You will need `TypeApplications` to use these.

Synopsis

- ordSpec :: (Show a, Ord a, Typeable a, GenValid a) => Spec
- ordSpecOnGen :: (Show a, Ord a, Typeable a) => Gen a -> String -> (a -> [a]) -> Spec
- ordSpecOnArbitrary :: (Show a, Ord a, Typeable a, Arbitrary a) => Spec

# Documentation

ordSpec :: (Show a, Ord a, Typeable a, GenValid a) => Spec Source #

Standard test spec for properties of Ord instances for valid values

Example usage:

    ordSpec @Int

ordSpecOnGen :: (Show a, Ord a, Typeable a) => Gen a -> String -> (a -> [a]) -> Spec Source #

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

Example usage:

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

ordSpecOnArbitrary :: (Show a, Ord a, Typeable a, Arbitrary a) => Spec Source #

Standard test spec for properties of Ord instances for arbitrary values

Example usage:

    ordSpecOnArbitrary @Int