Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- createDirectoryIfMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m FilePath
- createDirectoryIfMissing_ :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
- createSubdirectoryIfMissing :: HasCallStack => MonadTest m => MonadIO m => FilePath -> FilePath -> m FilePath
- createSubdirectoryIfMissing_ :: HasCallStack => MonadTest m => MonadIO m => FilePath -> FilePath -> m ()
- copyFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m ()
- renameFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m ()
- createFileLink :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m ()
- listDirectory :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m [FilePath]
- appendFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> m ()
- writeFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> m ()
- openFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> IOMode -> m Handle
- readFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m String
- lbsWriteFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> ByteString -> m ()
- lbsReadFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ByteString
- textWriteFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> Text -> m ()
- textReadFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m Text
- copyRewriteJsonFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> FilePath -> (a -> a) -> m ()
- readJsonFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m (Either String a)
- readJsonFileOk :: forall a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m a
- rewriteJsonFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> (a -> a) -> m ()
- rewriteLbsJson :: forall a m. (MonadTest m, FromJSON a, ToJSON a, HasCallStack) => (a -> a) -> ByteString -> m ByteString
- copyRewriteYamlFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> FilePath -> (a -> a) -> m ()
- readYamlFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m (Either ParseException a)
- readYamlFileOk :: forall a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m a
- rewriteYamlFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> (a -> a) -> m ()
- rewriteLbsYaml :: forall a m. (MonadTest m, FromJSON a, ToJSON a, HasCallStack) => (a -> a) -> ByteString -> m ByteString
- cat :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
- assertIsJsonFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
- assertIsYamlFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
- assertFileExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
- assertFilesExist :: (MonadTest m, MonadIO m, HasCallStack) => [FilePath] -> m ()
- assertFileMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
- assertFilesMissing :: (MonadTest m, MonadIO m, HasCallStack) => [FilePath] -> m ()
- assertFileOccurences :: (MonadTest m, MonadIO m, HasCallStack) => Int -> String -> FilePath -> m ()
- assertFileLines :: (MonadTest m, MonadIO m, HasCallStack) => (Int -> Bool) -> FilePath -> m ()
- assertEndsWithSingleNewline :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
- appendFileTimeDelta :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> UTCTime -> m ()
- assertDirectoryMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
- assertDirectoryExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
Documentation
createDirectoryIfMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m FilePath Source #
Create the directory
directory if it is missing.
createDirectoryIfMissing_ :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () Source #
Create the directory
directory if it is missing.
createSubdirectoryIfMissing :: HasCallStack => MonadTest m => MonadIO m => FilePath -> FilePath -> m FilePath Source #
Create the subdirectory
subdirectory if it is missing. The subdirectory is returned.
createSubdirectoryIfMissing_ :: HasCallStack => MonadTest m => MonadIO m => FilePath -> FilePath -> m () Source #
Create the subdirectory
subdirectory if it is missing. The subdirectory is returned.
copyFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () Source #
Copy the contents of the src
file to the dst
file.
renameFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () Source #
Rename the src
file to dst
.
createFileLink :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () Source #
Create a symbolic link from dst
to src
.
listDirectory :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m [FilePath] Source #
List p
directory.
appendFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> m () Source #
Append contents
to the filePath
file.
writeFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> m () Source #
Write contents
to the filePath
file.
openFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> IOMode -> m Handle Source #
Open a handle to the filePath
file.
readFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m String Source #
Read the contents of the filePath
file.
lbsWriteFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> ByteString -> m () Source #
Write contents
to the filePath
file.
lbsReadFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ByteString Source #
Read the contents of the filePath
file.
textWriteFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> Text -> m () Source #
Write contents
to the filePath
file.
textReadFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m Text Source #
Read the contents of the filePath
file.
copyRewriteJsonFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> FilePath -> (a -> a) -> m () Source #
Rewrite the filePath
JSON file using the function f
.
readJsonFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m (Either String a) Source #
readJsonFileOk :: forall a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m a Source #
Read the filePath
file as JSON. Same as readJsonFile
but fails on error. Use
readJsonFileOk @
to decode into Value
Value
.
rewriteJsonFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> (a -> a) -> m () Source #
Rewrite the filePath
JSON file using the function f
.
rewriteLbsJson :: forall a m. (MonadTest m, FromJSON a, ToJSON a, HasCallStack) => (a -> a) -> ByteString -> m ByteString Source #
copyRewriteYamlFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> FilePath -> (a -> a) -> m () Source #
Rewrite the filePath
YAML file using the function f
.
readYamlFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m (Either ParseException a) Source #
Read the filePath
file as YAML.
readYamlFileOk :: forall a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m a Source #
Read the filePath
file as YAML. Same as readYamlFile
but fails on error.
rewriteYamlFile :: forall a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> (a -> a) -> m () Source #
Rewrite the filePath
YAML file using the function f
.
rewriteLbsYaml :: forall a m. (MonadTest m, FromJSON a, ToJSON a, HasCallStack) => (a -> a) -> ByteString -> m ByteString Source #
cat :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () Source #
Annotate the contents of the filePath
file.
assertIsJsonFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () Source #
Assert the filePath
can be parsed as JSON.
assertIsYamlFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () Source #
Assert the filePath
can be parsed as YAML.
assertFileExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () Source #
Asserts that the given file exists.
assertFilesExist :: (MonadTest m, MonadIO m, HasCallStack) => [FilePath] -> m () Source #
Asserts that all of the given files exist.
assertFileMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () Source #
Asserts that the given file is missing.
assertFilesMissing :: (MonadTest m, MonadIO m, HasCallStack) => [FilePath] -> m () Source #
Asserts that all of the given files are missing.
assertFileOccurences :: (MonadTest m, MonadIO m, HasCallStack) => Int -> String -> FilePath -> m () Source #
Assert the file contains the given number of occurrences of the given string
assertFileLines :: (MonadTest m, MonadIO m, HasCallStack) => (Int -> Bool) -> FilePath -> m () Source #
Assert the file contains the given number of occurrences of the given string
assertEndsWithSingleNewline :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () Source #
Assert the file contains the given number of occurrences of the given string
appendFileTimeDelta :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> UTCTime -> m () Source #
Write contents
to the filePath
file.
assertDirectoryMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () Source #
Asserts that the given directory is missing.
assertDirectoryExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () Source #
Asserts that the given directory exists.