waargonaut-0.5.2.0: JSON wrangling

Safe HaskellNone
LanguageHaskell2010

Waargonaut.Test

Description

Helper functions for testing your Decoder and Encoder functions.

Synopsis

Documentation

roundTripSimple :: (Eq b, Monad f, CharParsing f, Monad g, Show e) => (f Json -> ByteString -> Either e Json) -> Encoder g b -> Decoder g b -> b -> g (Either (DecodeError, CursorHistory) Bool) Source #

Test a Encoder and Decoder pair are able to maintain the 'round trip' property. That is, if you encode a given value, and then decode it, you should have the exact same value that you started with.