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

Safe HaskellNone

Data.API.Tools.JSONTests

Synopsis

Documentation

jsonTestsTool :: Name -> APIToolSource

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 -> BoolSource

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

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

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