Safe Haskell | None |
---|---|
Language | Haskell2010 |
Internal module, use at your own risk.
- roundtripSpecs :: forall a. (Typeable a, Eq a, Show a, Arbitrary a, ToJSON a, FromJSON a) => Proxy a -> Spec
- genericAesonRoundtripWithNote :: forall a. (Typeable a, Eq a, Show a, Arbitrary a, ToJSON a, FromJSON a) => Proxy a -> Maybe String -> Spec
- addBrackets :: String -> String
- shouldBeIdentity :: (Eq a, Show a, Arbitrary a) => Proxy a -> (a -> IO a) -> Property
- aesonDecodeIO :: FromJSON a => ByteString -> IO a
Documentation
roundtripSpecs :: forall a. (Typeable a, Eq a, Show a, Arbitrary a, ToJSON a, FromJSON a) => Proxy a -> Spec Source #
Allows to obtain a roundtrip test to check whether values of the given type can be successfully converted to JSON and back.
roundtripSpecs
will
genericAesonRoundtripWithNote :: forall a. (Typeable a, Eq a, Show a, Arbitrary a, ToJSON a, FromJSON a) => Proxy a -> Maybe String -> Spec Source #
addBrackets :: String -> String Source #
shouldBeIdentity :: (Eq a, Show a, Arbitrary a) => Proxy a -> (a -> IO a) -> Property Source #
hspec style combinator to easily write tests that check the a given operation returns the same value it was given, e.g. roundtrip tests.
aesonDecodeIO :: FromJSON a => ByteString -> IO a Source #