| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Cardano.CLI.Util
Synopsis
- assertDirectoryMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
- checkTxCddlFormat :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m ()
- checkTextEnvelopeFormat :: (MonadTest m, MonadIO m, HasCallStack) => TextEnvelopeType -> FilePath -> FilePath -> m ()
- equivalence :: (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m ()
- execCardanoCLI :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => [String] -> m String
- execCardanoCLIWithEnvVars :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => [(String, String)] -> [String] -> m String
- execDetailCardanoCLI :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => [String] -> m (ExitCode, String, String)
- execDetailConfigCardanoCLI :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => ExecConfig -> [String] -> m (ExitCode, String, String)
- tryExecCardanoCLI :: forall (m :: Type -> Type). (MonadCatch m, MonadIO m, HasCallStack) => [String] -> PropertyT m (Either Failure String)
- propertyOnce :: PropertyT (ResourceT IO) () -> Property
- withSnd :: (a -> b) -> a -> (a, b)
- noteInputFile :: (MonadTest m, HasCallStack) => FilePath -> m FilePath
- noteTempFile :: (MonadTest m, HasCallStack) => FilePath -> FilePath -> m FilePath
- redactJsonField :: (MonadTest m, MonadIO m, HasCallStack) => Text -> Text -> FilePath -> FilePath -> m ()
- watchdogProp :: HasCallStack => Property -> Property
Documentation
assertDirectoryMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () Source #
Asserts that the given directory is missing.
Arguments
| :: (MonadTest m, MonadIO m, HasCallStack) | |
| => FilePath | Reference/golden file |
| -> FilePath | Newly created file |
| -> m () |
checkTextEnvelopeFormat :: (MonadTest m, MonadIO m, HasCallStack) => TextEnvelopeType -> FilePath -> FilePath -> m () Source #
Checks that the tvType and tvDescription are equivalent between two files.
equivalence :: (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m () Source #
Check for equivalence between two types and perform a file cleanup on failure.
Arguments
| :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) | |
| => [String] | Arguments to the CLI command |
| -> m String | Captured stdout |
Execute cardano-cli via the command line.
Waits for the process to finish and returns the stdout.
execCardanoCLIWithEnvVars Source #
Arguments
| :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) | |
| => [(String, String)] | Environment variables to set |
| -> [String] | Arguments to the CLI command |
| -> m String |
Execute cardano-cli via the command line but set environment variables. Fails if the process returns a non-zero exit code.
Waits for the process to finish and returns the stdout.
Arguments
| :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) | |
| => [String] | Arguments to the CLI command |
| -> m (ExitCode, String, String) | exit code, stdout, stderr |
Execute cardano-cli via the command line, expecting it to fail.
Waits for the process to finish and returns the exit code, stdout and stderr.
execDetailConfigCardanoCLI Source #
Arguments
| :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) | |
| => ExecConfig | Configuration for the execution |
| -> [String] | Arguments to the CLI command |
| -> m (ExitCode, String, String) | Exit code, stdout, stderr |
Execute cardano-cli via the command line, expecting it to fail, and accepting custom config.
Waits for the process to finish and returns the exit code, stdout and stderr.
Arguments
| :: forall (m :: Type -> Type). (MonadCatch m, MonadIO m, HasCallStack) | |
| => [String] | Arguments to the CLI command |
| -> PropertyT m (Either Failure String) | Captured stdout, or error in case of failures |
propertyOnce :: PropertyT (ResourceT IO) () -> Property Source #
withSnd :: (a -> b) -> a -> (a, b) Source #
Return the supply value with the result of the supplied function as a tuple
noteInputFile :: (MonadTest m, HasCallStack) => FilePath -> m FilePath Source #
Return the input file path after annotating it relative to the project root directory
noteTempFile :: (MonadTest m, HasCallStack) => FilePath -> FilePath -> m FilePath Source #
Return the test file path after annotating it relative to the project root directory
redactJsonField :: (MonadTest m, MonadIO m, HasCallStack) => Text -> Text -> FilePath -> FilePath -> m () Source #
watchdogProp :: HasCallStack => Property -> Property Source #