Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- diffVsGoldenFile :: HasCallStack => (MonadIO m, MonadTest m) => String -> FilePath -> m ()
- diffFileVsGoldenFile :: HasCallStack => (MonadIO m, MonadTest m) => FilePath -> FilePath -> m ()
Documentation
:: HasCallStack | |
=> (MonadIO m, MonadTest m) | |
=> String | Actual content |
-> FilePath | Reference file |
-> m () |
Diff contents against the golden file. If CREATE_GOLDEN_FILES environment is set to "1", then should the golden file not exist it would be created. If RECREATE_GOLDEN_FILES is set to "1", then should the golden file exist it would be recreated. If GOLDEN_FILE_LOG_FILE is set to a filename, then the golden file path will be logged to the specified file.
Set the environment variable when you intend to generate or re-generate the golden file for example when running the test for the first time or if the golden file genuinely needs to change.
To re-generate a golden file you must also delete the golden file because golden files are never overwritten.
TODO: Improve the help output by saying the difference of each input.
:: HasCallStack | |
=> (MonadIO m, MonadTest m) | |
=> FilePath | Actual file |
-> FilePath | Reference file |
-> m () |
Diff file against the golden file. If CREATE_GOLDEN_FILES environment is set to "1", then should the gold file not exist it would be created. If GOLDEN_FILE_LOG_FILE is set to a filename, then the golden file path will be logged to the specified file.
Set the environment variable when you intend to generate or re-generate the golden file for example when running the test for the first time or if the golden file genuinely needs to change.
To re-generate a golden file you must also delete the golden file because golden files are never overwritten.