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

Safe Haskell | None
Language | Haskell2010

Test.Validity.Utils

Description

Utilities for defining your own validity `Spec`s

You will need `TypeApplications` to use these.

Synopsis

- nameOf :: forall {k} (a :: k). Typeable a => String
- genDescr :: forall {k} (a :: k). Typeable a => String -> String
- binRelStr :: forall {k} (a :: k). Typeable a => String -> String
- shouldFail :: Property -> Property
- failsBecause :: String -> SpecWith () -> SpecWith ()
- newtype Anon a = Anon a
- shouldBeValid :: (Show a, Validity a) => a -> Expectation
- shouldBeInvalid :: (Show a, Validity a) => a -> Expectation

# Documentation

nameOf :: forall {k} (a :: k). Typeable a => String Source #

genDescr :: forall {k} (a :: k). Typeable a => String -> String Source #

binRelStr :: forall {k} (a :: k). Typeable a => String -> String Source #

shouldFail :: Property -> Property Source #

failsBecause :: String -> SpecWith () -> SpecWith () Source #

Asserts that a given `Spec` tree fails _somewhere_.

It also shows the given string when reporting that the tree unexpectedly succeeded.

newtype Anon a Source #

Constructors

Anon a |

#### Instances

Instances details

Functor Anon Source # |
Instance details Defined in Test.Validity.Utils Methods fmap :: (a -> b) -> Anon a -> Anon b Source # (<$) :: a -> Anon b -> Anon a Source #
Show (Anon a) Source # |
Instance details Defined in Test.Validity.Utils Methods showsPrec :: Int -> Anon a -> ShowS Source # show :: Anon a -> String Source # showList :: [Anon a] -> ShowS Source #

shouldBeValid :: (Show a, Validity a) => a -> Expectation Source #

shouldBeInvalid :: (Show a, Validity a) => a -> Expectation Source #