cardano-api:gen
Safe HaskellNone
LanguageHaskell2010

Test.Hedgehog.Golden.ErrorMessage

Synopsis

Documentation

testAllErrorMessages Source #

Arguments

:: (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 #

Arguments

:: (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.

testErrorMessage Source #

Arguments

:: (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.

testErrorMessage_ Source #

Arguments

:: (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.