Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- testAllErrorMessages :: (HasCallStack, Data a, Error a) => FilePath -> [a] -> TestTree
- testAllErrorMessages_ :: (HasCallStack, Error a) => FilePath -> String -> String -> [(String, a)] -> TestTree
- testErrorMessage :: (HasCallStack, Data a, Error a) => FilePath -> a -> TestTree
- testErrorMessage_ :: (HasCallStack, Error a) => FilePath -> String -> String -> String -> a -> TestTree
- diffVsGoldenFile :: (HasCallStack, MonadIO m, MonadTest m) => String -> FilePath -> m ()
- writeGoldenFile :: (HasCallStack, MonadIO m, MonadTest m) => FilePath -> String -> m ()
- recreateGoldenFiles :: Bool
- createGoldenFiles :: Bool
- writeFile' :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> m ()
- checkAgainstGoldenFile :: (HasCallStack, MonadIO m, MonadTest m) => FilePath -> [String] -> m ()
- sem :: QSem
- semBracket :: IO a -> IO a
- mGoldenFileLogFile :: Maybe FilePath
- reportGoldenFileMissing :: (HasCallStack, MonadIO m, MonadTest m) => FilePath -> m ()
Documentation
:: (HasCallStack, Data a, Error a) | |
=> FilePath | golden files location |
-> [a] | list of values to test against |
-> TestTree |
Generate test tree for the list of values. This TestTree
will serialize the values using Error
instance and compare them against golden files in the provided location.
testAllErrorMessages_ Source #
:: (HasCallStack, Error a) | |
=> FilePath | golden files path |
-> String | module name |
-> String | type name |
-> [(String, a)] | list of constructor names and values |
-> TestTree |
Creates error messages for all values and tests them against the golden files.
An escape hatch when adding of 'Data a' instance gets impossible (like when we embed TypeRep
in our error
data types) or requires significant multi-package changes and outweighs the benefits here.
:: (HasCallStack, Data a, Error a) | |
=> FilePath | golden files path |
-> a | value to test |
-> TestTree |
Create TestTree
validating serialized value a
using Error
against the golden files.
:: (HasCallStack, Error a) | |
=> FilePath | golden files path |
-> String | module name |
-> String | type name |
-> String | constructor name |
-> a | value to test |
-> TestTree |
Create TestTree
validating serialized value a
using Error
against the golden files.
Requires providing a module name, a type name and a constructor name of a
. Useful when 'Data a'
instance is not available.
:: (HasCallStack, MonadIO m, MonadTest m) | |
=> String | Actual content |
-> FilePath | Reference file |
-> m () |
writeGoldenFile :: (HasCallStack, MonadIO m, MonadTest m) => FilePath -> String -> m () Source #
writeFile' :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> m () Source #
checkAgainstGoldenFile :: (HasCallStack, MonadIO m, MonadTest m) => FilePath -> [String] -> m () Source #
semBracket :: IO a -> IO a Source #
reportGoldenFileMissing :: (HasCallStack, MonadIO m, MonadTest m) => FilePath -> m () Source #