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

HaskellWorks.Polysemy.Hedgehog.Assert

Synopsis

Documentation

data Hedgehog m rv Source #

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

Fail when the result is Left.

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

leftFailJson :: 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 r a. Member Hedgehog r => ToJSON e => HasCallStack => Sem r (Either e a) -> Sem r a Source #

leftFailJsonPretty :: 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 r a. Member Hedgehog r => ToJSON e => HasCallStack => Sem r (Either e a) -> Sem r a Source #

leftFailPretty :: 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 r a. Member Hedgehog r => Pretty e => HasCallStack => Sem r (Either e a) -> Sem r a Source #

leftFailYaml :: 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 r a. Member Hedgehog r => ToJSON e => HasCallStack => Sem r (Either e a) -> Sem r a Source #

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

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

Deprecated: Use trapFail instead

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

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

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

trapFailYaml :: forall e r a. 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 #

byDeadlineM :: 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 :: 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 :: 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

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

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

Assert the filePath can be parsed as JSON.

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

Assert the filePath can be parsed as YAML.

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

Asserts that the given file exists.

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

Asserts that all of the given files exist.

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

Asserts that the given file is missing.

assertFilesMissing :: 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 :: 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 :: 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 :: 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 :: HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member Log r => FilePath -> Sem r () Source #

Asserts that the given directory exists.

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

Asserts that the given directory is missing.