hspec-golden-aeson-0.6.0.0: Use tests to monitor changes in Aeson serialization

Copyright(c) Plow Technologies 2016
LicenseBSD3
Maintainermchaver@gmail.com
StabilityBeta
Safe HaskellNone
LanguageHaskell2010

Test.Aeson.Internal.RoundtripSpecs

Description

Internal module, use at your own risk.

Synopsis

Documentation

roundtripSpecs :: forall a. (Typeable a, Arbitrary a, ToJSON a, FromJSON a) => Proxy a -> Spec Source #

A roundtrip test to check whether values of the given type can be successfully converted to JSON and back to a Haskell value.

roundtripSpecs will

  • create random values (using Arbitrary),
  • 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).

genericAesonRoundtripWithNote :: forall a. (Typeable a, Arbitrary a, ToJSON a, FromJSON a) => Proxy a -> Maybe String -> Spec Source #

Same as roundtripSpecs, but optionally add notes to the describe function.

genericAesonRoundtripWithNotePlain :: forall a. (Arbitrary a, ToJSON a, FromJSON a) => Proxy a -> Maybe String -> String -> Spec Source #

Same as genericAesonRoundtripWithNote, but no need for Typeable, Eq, or Show