Copyright | (c) Plow Technologies 2016 |
---|---|
License | BSD3 |
Maintainer | mchaver@gmail.com |
Stability | Beta |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data ComparisonFile
- data RandomMismatchOption
- data Settings = Settings {}
- data GoldenDirectoryOption
- = CustomDirectoryName String
- | GoldenDirectory
- 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
- data AesonDecodeError = AesonDecodeError String
- newtype JsonShow a = JsonShow a
- newtype TopDir = TopDir {
- unTopDir :: FilePath
- newtype ModuleName = ModuleName {
- unModuleName :: FilePath
- newtype TypeName = TypeName {
- unTypeName :: FilePath
- data TypeNameInfo a = TypeNameInfo {
- typeNameTopDir :: TopDir
- typeNameModuleName :: Maybe ModuleName
- typeNameTypeName :: TypeName
- mkTypeNameInfo :: forall a. Arbitrary a => Typeable a => Settings -> Proxy a -> IO (TypeNameInfo a)
- encodePrettySortedKeys :: ToJSON a => a -> ByteString
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.
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.
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 |
Settings | |
|
data GoldenDirectoryOption Source #
A custom directory name or a preselected directory name.
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.
data AesonDecodeError Source #
AesonDecodeError String |
Instances
Eq AesonDecodeError Source # | |
Defined in Test.Aeson.Internal.Utils (==) :: AesonDecodeError -> AesonDecodeError -> Bool (/=) :: AesonDecodeError -> AesonDecodeError -> Bool | |
Show AesonDecodeError Source # | |
Defined in Test.Aeson.Internal.Utils showsPrec :: Int -> AesonDecodeError -> ShowS show :: AesonDecodeError -> String showList :: [AesonDecodeError] -> ShowS | |
Exception AesonDecodeError Source # | |
Defined in Test.Aeson.Internal.Utils toException :: AesonDecodeError -> SomeException fromException :: SomeException -> Maybe AesonDecodeError displayException :: AesonDecodeError -> String |
Used to eliminate the need for an Eq instance
JsonShow a |
Instances
ToJSON a => Show (JsonShow a) Source # | |
FromJSON a => FromJSON (JsonShow a) Source # | |
Defined in Test.Aeson.Internal.Utils parseJSON :: Value -> Parser (JsonShow a) parseJSONList :: Value -> Parser [JsonShow a] | |
ToJSON a => ToJSON (JsonShow a) Source # | |
Defined in Test.Aeson.Internal.Utils toEncoding :: JsonShow a -> Encoding toJSONList :: [JsonShow a] -> Value toEncodingList :: [JsonShow a] -> Encoding | |
Arbitrary a => Arbitrary (JsonShow a) Source # | |
newtype ModuleName Source #
ModuleName | |
|
Instances
Eq ModuleName Source # | |
Defined in Test.Aeson.Internal.Utils (==) :: ModuleName -> ModuleName -> Bool (/=) :: ModuleName -> ModuleName -> Bool | |
Read ModuleName Source # | |
Defined in Test.Aeson.Internal.Utils readsPrec :: Int -> ReadS ModuleName readList :: ReadS [ModuleName] readPrec :: ReadPrec ModuleName readListPrec :: ReadPrec [ModuleName] | |
Show ModuleName Source # | |
Defined in Test.Aeson.Internal.Utils showsPrec :: Int -> ModuleName -> ShowS show :: ModuleName -> String showList :: [ModuleName] -> ShowS |
TypeName | |
|
data TypeNameInfo a Source #
TypeNameInfo | |
|
Instances
Eq (TypeNameInfo a) Source # | |
Defined in Test.Aeson.Internal.Utils (==) :: TypeNameInfo a -> TypeNameInfo a -> Bool (/=) :: TypeNameInfo a -> TypeNameInfo a -> Bool | |
Read (TypeNameInfo a) Source # | |
Defined in Test.Aeson.Internal.Utils readsPrec :: Int -> ReadS (TypeNameInfo a) readList :: ReadS [TypeNameInfo a] readPrec :: ReadPrec (TypeNameInfo a) readListPrec :: ReadPrec [TypeNameInfo a] | |
Show (TypeNameInfo a) Source # | |
Defined in Test.Aeson.Internal.Utils showsPrec :: Int -> TypeNameInfo a -> ShowS show :: TypeNameInfo a -> String showList :: [TypeNameInfo a] -> ShowS |
mkTypeNameInfo :: forall a. Arbitrary a => Typeable a => Settings -> Proxy a -> IO (TypeNameInfo a) Source #
encodePrettySortedKeys :: ToJSON a => a -> ByteString Source #