waargonaut-0.8.0.1: 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) => (forall a. f a -> Text -> Either e a) -> 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.