api-tools-0.2: DSL for generating API boilerplate and docs

Safe HaskellNone
LanguageHaskell2010

Data.API.Tools.JSONTests

Synopsis

Documentation

jsonTestsTool :: Name -> APITool Source

Tool to generate a list of tests of type [(String, Property)] with the given name. This depends on jsonTool and quickCheckTool.

prop_decodesTo :: forall a. (Eq a, FromJSONWithErrs a) => Value -> a -> Bool Source

QuickCheck property that a Value decodes to an expected Haskell value, using fromJSONWithErrs

prop_resultsMatchRoundtrip :: forall a. (Eq a, ToJSON a, FromJSONWithErrs a) => a -> Bool Source

QuickCheck property that Haskell values can be encoded with toJSON and decoded with fromJSONWithErrs to get the original value