| Copyright | (c) Plow Technologies 2016 |
|---|---|
| License | BSD3 |
| Maintainer | mchaver@gmail.com |
| Stability | Beta |
| Safe Haskell | None |
| Language | Haskell2010 |
Test.Aeson.Internal.Utils
Description
- data ComparisonFile
- data RandomMismatchOption
- data Settings = Settings {}
- data GoldenDirectoryOption
- defaultSettings :: Settings
- addBrackets :: String -> String
- shouldBeIdentity :: (Eq a, Show a, Arbitrary a) => Proxy a -> (a -> IO a) -> Property
- checkAesonEncodingEquality :: forall a. (ToJSON a, FromJSON a) => JsonShow a -> Bool
- aesonDecodeIO :: FromJSON a => ByteString -> IO a
- newtype JsonShow a = JsonShow a
- newtype TopDir = TopDir {}
- newtype ModuleName = ModuleName {}
- newtype TypeName = TypeName {}
- data TypeNameInfo a = TypeNameInfo {}
- mkTypeNameInfo :: forall a. Arbitrary a => Typeable a => Settings -> Proxy a -> IO (TypeNameInfo a)
Documentation
data ComparisonFile Source #
Option to indicate whether to create a separate comparison file or overwrite the golden file.
A separate file allows you to use diff to compare.
Overwriting allows you to use source control tools for comparison.
Constructors
| FaultyFile | Create a new faulty file when tests fail |
| OverwriteGoldenFile | Overwrite the golden file when tests fail |
data RandomMismatchOption Source #
Option indicating whether to fail tests when the random seed does not produce the same values as in the golden file. Default is to output a warning.
Constructors
| RandomMismatchWarning | Only output a warning when the random seed does not produce the same values |
| RandomMismatchError | Fail the test when the random seed does not produce the same value |
Constructors
| Settings | |
Fields
| |
data GoldenDirectoryOption Source #
A custom directory name or a preselected directory name.
Constructors
| CustomDirectoryName String | |
| GoldenDirectory |
defaultSettings :: Settings Source #
The default settings for general use cases.
addBrackets :: String -> String Source #
put brackets around a String.
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.
checkAesonEncodingEquality :: forall a. (ToJSON a, FromJSON a) => JsonShow a -> Bool Source #
This function will compare one JSON encoding to a subsequent JSON encoding, thus eliminating the need for an Eq instance
aesonDecodeIO :: FromJSON a => ByteString -> IO a Source #
run decode in IO, if it returns Left then throw an error.
Used to eliminate the need for an Eq instance
Constructors
| JsonShow a |
Constructors
| TypeName | |
Fields | |
data TypeNameInfo a Source #
Constructors
| TypeNameInfo | |
Fields | |
Instances
| Eq (TypeNameInfo a) Source # | |
| Read (TypeNameInfo a) Source # | |
| Show (TypeNameInfo a) Source # | |
mkTypeNameInfo :: forall a. Arbitrary a => Typeable a => Settings -> Proxy a -> IO (TypeNameInfo a) Source #