hw-polysemy-0.3.0.0: Opinionated polysemy library
Safe HaskellSafe-Inferred
LanguageHaskell2010

HaskellWorks.Polysemy.Hedgehog.Assert

Synopsis

Documentation

data Hedgehog m rv Source #

leftFail :: forall e a r. Member Hedgehog r => Show e => HasCallStack => Either e a -> Sem r a Source #

Fail when the result is Left.

leftFailM :: forall e a r. Member Hedgehog r => Show e => HasCallStack => Sem r (Either e a) -> Sem r a Source #

leftFailJson :: forall e a r. Member Hedgehog r => ToJSON e => HasCallStack => Either e a -> Sem r a Source #

Fail when the result is Left with the error message as JSON.

leftFailJsonM :: forall e a r. Member Hedgehog r => ToJSON e => HasCallStack => Sem r (Either e a) -> Sem r a Source #

leftFailJsonPretty :: forall e a r. Member Hedgehog r => ToJSON e => HasCallStack => Either e a -> Sem r a Source #

Fail when the result is Left with the error message as JSON.

leftFailJsonPrettyM :: forall e a r. Member Hedgehog r => ToJSON e => HasCallStack => Sem r (Either e a) -> Sem r a Source #

leftFailPretty :: forall e a r. Member Hedgehog r => Pretty e => HasCallStack => Either e a -> Sem r a Source #

Fail when the result is Left with the error message as JSON.

leftFailPrettyM :: forall e a r. Member Hedgehog r => Pretty e => HasCallStack => Sem r (Either e a) -> Sem r a Source #

leftFailYaml :: forall e a r. Member Hedgehog r => ToJSON e => HasCallStack => Either e a -> Sem r a Source #

Fail when the result is Left with the error message as JSON.

leftFailYamlM :: forall e a r. Member Hedgehog r => ToJSON e => HasCallStack => Sem r (Either e a) -> Sem r a Source #

nothingFail :: forall a r. Member Hedgehog r => HasCallStack => Maybe a -> Sem r a Source #

nothingFailM :: forall a r. Member Hedgehog r => HasCallStack => Sem r (Maybe a) -> Sem r a Source #

requireHead :: forall a r. Member Hedgehog r => HasCallStack => [a] -> Sem r a Source #

catchFail :: forall e a r. Member Hedgehog r => HasCallStack => Show e => Sem (Error e ': r) a -> Sem r a Source #

Deprecated: Use trapFail instead

trapFail :: forall e a r. Member Hedgehog r => HasCallStack => Show e => Sem (Error e ': r) a -> Sem r a Source #

trapFailJson :: forall e a r. Member Hedgehog r => HasCallStack => ToJSON e => Sem (Error e ': r) a -> Sem r a Source #

trapFailJsonPretty :: forall e a r. Member Hedgehog r => HasCallStack => ToJSON e => Sem (Error e ': r) a -> Sem r a Source #

trapFailYaml :: forall e a r m. MonadIO m => Member (Embed m) r => Member Hedgehog r => HasCallStack => ToJSON e => Sem (Error e ': r) a -> Sem r a Source #

evalIO :: forall r a. (Member Hedgehog r, HasCallStack) => IO a -> Sem r a Source #

failure :: forall a r. Member Hedgehog r => HasCallStack => Sem r a Source #

byDeadlineIO :: forall a r m. HasCallStack => Member (Embed m) r => Member (Embed IO) r => Member Hedgehog r => Member Log r => NominalDiffTime -> UTCTime -> String -> m a -> Sem r a Source #

byDeadlineM :: forall a r. HasCallStack => Member Hedgehog r => Member Log r => Member (Embed IO) r => NominalDiffTime -> UTCTime -> String -> Sem r a -> Sem r a Source #

Run the operation f once a second until it returns True or the deadline expires.

Expiration of the deadline results in an assertion failure

byDurationIO :: forall b r m. HasCallStack => Member (Embed m) r => Member (Embed IO) r => Member Hedgehog r => Member Log r => NominalDiffTime -> NominalDiffTime -> String -> m b -> Sem r b Source #

Run the operation f once a second until it returns True or the duration expires.

Expiration of the duration results in an assertion failure

byDurationM :: forall b r. HasCallStack => Member (Embed IO) r => Member Hedgehog r => Member Log r => NominalDiffTime -> NominalDiffTime -> String -> Sem r b -> Sem r b Source #

Run the operation f once a second until it returns True or the duration expires.

Expiration of the duration results in an assertion failure

(===) :: forall a r. Member Hedgehog r => Eq a => Show a => HasCallStack => a -> a -> Sem r () Source #

assertIsJsonFile_ :: forall r. HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member Log r => FilePath -> Sem r () Source #

Assert the filePath can be parsed as JSON.

assertIsYamlFile :: forall r. HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member Log r => FilePath -> Sem r () Source #

Assert the filePath can be parsed as YAML.

assertFileExists :: forall r. HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member Log r => FilePath -> Sem r () Source #

Asserts that the given file exists.

assertFilesExist :: forall r. HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member Log r => [FilePath] -> Sem r () Source #

Asserts that all of the given files exist.

assertFileMissing :: forall r. HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member Log r => FilePath -> Sem r () Source #

Asserts that the given file is missing.

assertFilesMissing :: forall r. HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member Log r => [FilePath] -> Sem r () Source #

Asserts that all of the given files are missing.

assertFileOccurences :: forall r. HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member Log r => Int -> String -> FilePath -> Sem r () Source #

Assert the file contains the given number of occurrences of the given string

assertFileLines :: forall r. HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member Log r => (Int -> Bool) -> FilePath -> Sem r () Source #

Assert the file contains the given number of occurrences of the given string

assertEndsWithSingleNewline :: forall r. HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member Log r => FilePath -> Sem r () Source #

Assert the file contains the given number of occurrences of the given string

assertDirectoryExists :: forall r. HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member Log r => FilePath -> Sem r () Source #

Asserts that the given directory exists.

assertDirectoryMissing :: forall r. HasCallStack => Member Hedgehog r => Member Log r => Member (Embed IO) r => FilePath -> Sem r () Source #

Asserts that the given directory is missing.