Copyright | (c) Plow Technologies 2016 |
---|---|
License | BSD3 |
Maintainer | mchaver@gmail.com |
Stability | Beta |
Safe Haskell | None |
Language | Haskell2010 |
Internal module, use at your own risk.
Synopsis
- roundtripADTSpecs :: forall a. (Arbitrary a, ToADTArbitrary a, Eq a, Show a, ToJSON a, FromJSON a) => Proxy a -> Spec
- genericAesonRoundtripADTWithNote :: forall a. (ToADTArbitrary a, Eq a, Show a, Arbitrary a, ToJSON a, FromJSON a) => Proxy a -> Maybe String -> Spec
Documentation
roundtripADTSpecs :: forall a. (Arbitrary a, ToADTArbitrary a, Eq a, Show a, ToJSON a, FromJSON a) => Proxy a -> Spec Source #
A roundtrip test to check whether values of all of constructors of the given type can be successfully converted to JSON and back to a Haskell value.
roundtripADTSpecs
will
- create random values for each constructor using
ToADTArbitrary
, - convert them into JSON using
ToJSON
, - read them back into Haskell using
FromJSON
and - make sure that the result is the same as the value it started with
using
Eq
.
genericAesonRoundtripADTWithNote :: forall a. (ToADTArbitrary a, Eq a, Show a, Arbitrary a, ToJSON a, FromJSON a) => Proxy a -> Maybe String -> Spec Source #
Same as roundtripADTSpecs
but has the option of passing a note to the
describe
function.