diff --git a/doc-index.json b/doc-index.json index b27c1636..7e9afba9 100644 --- a/doc-index.json +++ b/doc-index.json @@ -234,13 +234,13 @@ "link": "hedgehog-extras/Hedgehog-Extras-Test-Base.html#v:propertyOnce" }, { - "display_html": "workspace ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → (FilePath → m ()) → m ()", + "display_html": "workspace ∷ MonadTest m ⇒ HasCallStack ⇒ MonadResource m ⇒ FilePath → (FilePath → m ()) → m ()", "name": "workspace", "module": "Hedgehog.Extras.Test.Base", "link": "hedgehog-extras/Hedgehog-Extras-Test-Base.html#v:workspace" }, { - "display_html": "moduleWorkspace ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ String → (FilePath → m ()) → m ()", + "display_html": "moduleWorkspace ∷ (MonadTest m, MonadResource m, HasCallStack) ⇒ String → (FilePath → m ()) → m ()", "name": "moduleWorkspace", "module": "Hedgehog.Extras.Test.Base", "link": "hedgehog-extras/Hedgehog-Extras-Test-Base.html#v:moduleWorkspace" @@ -1044,7 +1044,7 @@ "link": "hedgehog-extras/Hedgehog-Extras-Test-Process.html#v:procFlex" }, { - "display_html": "binFlex ∷ (MonadTest m, MonadIO m) ⇒ StringString → m FilePath", + "display_html": "binFlex ∷ (HasCallStack, MonadTest m, MonadIO m) ⇒ StringString → m FilePath", "name": "binFlex", "module": "Hedgehog.Extras.Test.Process", "link": "hedgehog-extras/Hedgehog-Extras-Test-Process.html#v:binFlex" diff --git a/hedgehog-extras/Hedgehog-Extras-Test-Base.html b/hedgehog-extras/Hedgehog-Extras-Test-Base.html index 6c7e8df0..85894c7f 100644 --- a/hedgehog-extras/Hedgehog-Extras-Test-Base.html +++ b/hedgehog-extras/Hedgehog-Extras-Test-Base.html @@ -1,8 +1,8 @@ -Hedgehog.Extras.Test.Base
hedgehog-extras-0.6.5.0: Supplemental library for hedgehog
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hedgehog.Extras.Test.Base

Synopsis

Documentation

propertyOnceHasCallStackIntegration () → Property Source #

Run a property with only one test. This is intended for allowing hedgehog - to run unit tests.

workspace ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → (FilePath → m ()) → m () Source #

Create a workspace directory which will exist for at least the duration of +Hedgehog.Extras.Test.Base

hedgehog-extras-0.6.5.0: Supplemental library for hedgehog
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hedgehog.Extras.Test.Base

Synopsis

Documentation

propertyOnceHasCallStackIntegration () → Property Source #

Run a property with only one test. This is intended for allowing hedgehog + to run unit tests.

workspace ∷ MonadTest m ⇒ HasCallStack ⇒ MonadResource m ⇒ FilePath → (FilePath → m ()) → m () Source #

Create a workspace directory which will exist for at least the duration of the supplied block.

The directory will have the supplied prefix but contain a generated random suffix to prevent interference between tests

The directory will be deleted if the block succeeds, but left behind if - the block fails.

moduleWorkspace ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ String → (FilePath → m ()) → m () Source #

Create a workspace directory which will exist for at least the duration of + the block fails.

moduleWorkspace ∷ (MonadTest m, MonadResource m, HasCallStack) ⇒ String → (FilePath → m ()) → m () Source #

Create a workspace directory which will exist for at least the duration of the supplied block.

The directory will have the prefix as "$prefixPath/$moduleName" but contain a generated random suffix to prevent interference between tests

The directory will be deleted if the block succeeds, but left behind if the block fails.

The prefix argument should not contain directory delimeters.

note ∷ (MonadTest m, HasCallStack) ⇒ String → m String Source #

Annotate with the given string.

note_ ∷ (MonadTest m, HasCallStack) ⇒ String → m () Source #

Annotate the given string returning unit.

noteM ∷ (MonadTest m, MonadCatch m, HasCallStack) ⇒ m String → m String Source #

Annotate the given string in a monadic context.

noteM_ ∷ (MonadTest m, MonadCatch m, HasCallStack) ⇒ m String → m () Source #

Annotate the given string in a monadic context returning unit.

noteIO ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IO String → m String Source #

Annotate the given string in IO.

noteIO_ ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IO String → m () Source #

Annotate the given string in IO returning unit.

noteShow ∷ (MonadTest m, HasCallStack, Show a) ⇒ a → m a Source #

Annotate the given value.

noteShowPretty ∷ (MonadTest m, HasCallStack, Show a) ⇒ a → m a Source #

Annotate the given value, pretty printing it with indentation. Note that large data structures will take @@ -17,6 +17,6 @@ a significant amount of vertical screen space.

noteEachM ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m (f a) Source #

Annotate the each value in the given traversable in a monadic context.

noteEachPrettyM ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m (f a) Source #

Annotate the each value in the given traversable in a monadic context, pretty printing it with indentation. Note that large data structures will take a significant amount of vertical screen space.

noteEachM_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m () Source #

Annotate the each value in the given traversable in a monadic context returning unit.

noteEachPrettyM_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m () Source #

Annotate the each value in the given traversable in a monadic context returning unit, pretty printing it with indentation. Note that large data structures will take a significant amount of vertical screen space.

noteEach_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ f a → m () Source #

Annotate the each value in the given traversable returning unit.

noteEachPretty_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ f a → m () Source #

Annotate the each value in the given traversable returning unit, pretty printing it with indentation. Note that large data structures will take - a significant amount of vertical screen space.

noteTempFile ∷ (MonadTest m, HasCallStack) ⇒ FilePathFilePath → m FilePath Source #

Return the test file path after annotating it relative to the project root directory

headM ∷ (MonadTest m, HasCallStack) ⇒ [a] → m a Source #

indexM ∷ (MonadTest m, HasCallStack) ⇒ Int → [a] → m a Source #

fromJustM ∷ (MonadTest m, HasCallStack) ⇒ Maybe a → m a Source #

Index into a list. On failure, a friendly message is included in the test report.

nothingFail ∷ (MonadTest m, HasCallStack) ⇒ Maybe a → m a Source #

Fail when the result is Nothing.

nothingFailM ∷ (MonadTest m, HasCallStack) ⇒ m (Maybe a) → m a Source #

Fail when the computed result is Nothing.

leftFail ∷ (MonadTest m, Show e, HasCallStack) ⇒ Either e a → m a Source #

Fail when the result is Left.

leftFailM ∷ (MonadTest m, Show e, HasCallStack) ⇒ m (Either e a) → m a Source #

Fail when the computed result is Left.

onLeftMonad m ⇒ (e → m a) → m (Either e a) → m a Source #

onNothingMonad m ⇒ m a → m (Maybe a) → m a Source #

jsonErrorFail ∷ (MonadTest m, HasCallStack) ⇒ Result a → m a Source #

Fail when the result is Error.

jsonErrorFailM ∷ (MonadTest m, HasCallStack) ⇒ m (Result a) → m a Source #

Fail when the computed result is Error.

failWithCustom ∷ MonadTest m ⇒ CallStackMaybe Diff → String → m a Source #

Takes a CallStack so the error can be rendered at the appropriate call site.

failMessage ∷ MonadTest m ⇒ CallStackString → m a Source #

Takes a CallStack so the error can be rendered at the appropriate call site.

assertByDeadlineM ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTime → m Bool → m () 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

assertByDeadlineIO ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTimeIO Bool → m () 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

assertByDeadlineMFinally ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTime → m Bool → m () → m () Source #

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

The action g is run after expiration of the deadline, but before failure allowing for - additional annotations to be presented.

Expiration of the deadline results in an assertion failure

assertByDeadlineIOFinally ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTimeIO Bool → m () → m () Source #

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

The action g is run after expiration of the deadline, but before failure allowing for - additional annotations to be presented.

Expiration of the deadline results in an assertion failure

assertWith ∷ (MonadTest m, Show p, HasCallStack) ⇒ p → (p → Bool) → m () Source #

Run the test function against the value. Report the value on the failure.

assertWithM ∷ (MonadTest m, Show p, HasCallStack) ⇒ p → (p → m Bool) → m () Source #

Run the test function against the value. Report the value on the failure.

assertM ∷ (MonadTest m, HasCallStack) ⇒ m Bool → m () Source #

Run the monadic action f and assert the return value is True.

assertIO ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IO Bool → m () Source #

Run the IO action f and assert the return value is True.

assertWithinTolerance Source #

Arguments

∷ (Show a, Ord a, Num a, HasCallStack, MonadTest m) 
⇒ a

tested value v

→ a

expected value c

→ a

tolerance range r

→ m () 

Tests if |c - v| <= r

byDeadlineM ∷ ∀ m a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeUTCTimeString → m a → m 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

byDeadlineIO ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeUTCTimeStringIO a → m 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

byDurationM ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeNominalDiffTimeString → m a → m a 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

byDurationIO ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeNominalDiffTimeStringIO a → m a 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

type Integration a = PropertyT (ReaderT IntegrationState (ResourceT IO)) a Source #

release ∷ (MonadTest m, MonadIO m) ⇒ ReleaseKey → m () Source #

Release the given release key.

retry ∷ ∀ a. Int → (IntIntegration a) → Integration a Source #

retry' ∷ ∀ a. IntIntegration a → Integration a Source #

\ No newline at end of file + a significant amount of vertical screen space.

noteTempFile ∷ (MonadTest m, HasCallStack) ⇒ FilePathFilePath → m FilePath Source #

Return the test file path after annotating it relative to the project root directory

headM ∷ (MonadTest m, HasCallStack) ⇒ [a] → m a Source #

indexM ∷ (MonadTest m, HasCallStack) ⇒ Int → [a] → m a Source #

fromJustM ∷ (MonadTest m, HasCallStack) ⇒ Maybe a → m a Source #

Index into a list. On failure, a friendly message is included in the test report.

nothingFail ∷ (MonadTest m, HasCallStack) ⇒ Maybe a → m a Source #

Fail when the result is Nothing.

nothingFailM ∷ (MonadTest m, HasCallStack) ⇒ m (Maybe a) → m a Source #

Fail when the computed result is Nothing.

leftFail ∷ (MonadTest m, Show e, HasCallStack) ⇒ Either e a → m a Source #

Fail when the result is Left.

leftFailM ∷ (MonadTest m, Show e, HasCallStack) ⇒ m (Either e a) → m a Source #

Fail when the computed result is Left.

onLeftMonad m ⇒ (e → m a) → m (Either e a) → m a Source #

onNothingMonad m ⇒ m a → m (Maybe a) → m a Source #

jsonErrorFail ∷ (MonadTest m, HasCallStack) ⇒ Result a → m a Source #

Fail when the result is Error.

jsonErrorFailM ∷ (MonadTest m, HasCallStack) ⇒ m (Result a) → m a Source #

Fail when the computed result is Error.

failWithCustom ∷ MonadTest m ⇒ CallStackMaybe Diff → String → m a Source #

Takes a CallStack so the error can be rendered at the appropriate call site.

failMessage ∷ MonadTest m ⇒ CallStackString → m a Source #

Takes a CallStack so the error can be rendered at the appropriate call site.

assertByDeadlineM ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTime → m Bool → m () 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

assertByDeadlineIO ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTimeIO Bool → m () 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

assertByDeadlineMFinally ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTime → m Bool → m () → m () Source #

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

The action g is run after expiration of the deadline, but before failure allowing for + additional annotations to be presented.

Expiration of the deadline results in an assertion failure

assertByDeadlineIOFinally ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTimeIO Bool → m () → m () Source #

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

The action g is run after expiration of the deadline, but before failure allowing for + additional annotations to be presented.

Expiration of the deadline results in an assertion failure

assertWith ∷ (MonadTest m, Show p, HasCallStack) ⇒ p → (p → Bool) → m () Source #

Run the test function against the value. Report the value on the failure.

assertWithM ∷ (MonadTest m, Show p, HasCallStack) ⇒ p → (p → m Bool) → m () Source #

Run the test function against the value. Report the value on the failure.

assertM ∷ (MonadTest m, HasCallStack) ⇒ m Bool → m () Source #

Run the monadic action f and assert the return value is True.

assertIO ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IO Bool → m () Source #

Run the IO action f and assert the return value is True.

assertWithinTolerance Source #

Arguments

∷ (Show a, Ord a, Num a, HasCallStack, MonadTest m) 
⇒ a

tested value v

→ a

expected value c

→ a

tolerance range r

→ m () 

Tests if |c - v| <= r

byDeadlineM ∷ ∀ m a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeUTCTimeString → m a → m 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

byDeadlineIO ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeUTCTimeStringIO a → m 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

byDurationM ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeNominalDiffTimeString → m a → m a 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

byDurationIO ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeNominalDiffTimeStringIO a → m a 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

type Integration a = PropertyT (ReaderT IntegrationState (ResourceT IO)) a Source #

release ∷ (MonadTest m, MonadIO m) ⇒ ReleaseKey → m () Source #

Release the given release key.

retry ∷ ∀ a. Int → (IntIntegration a) → Integration a Source #

retry' ∷ ∀ a. IntIntegration a → Integration a Source #

\ No newline at end of file diff --git a/hedgehog-extras/Hedgehog-Extras-Test-Process.html b/hedgehog-extras/Hedgehog-Extras-Test-Process.html index 70581af5..df4871b8 100644 --- a/hedgehog-extras/Hedgehog-Extras-Test-Process.html +++ b/hedgehog-extras/Hedgehog-Extras-Test-Process.html @@ -1,4 +1,4 @@ -Hedgehog.Extras.Test.Process
hedgehog-extras-0.6.5.0: Supplemental library for hedgehog
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hedgehog.Extras.Test.Process

Synopsis

Documentation

createProcess ∷ (MonadTest m, MonadResource m, HasCallStack) ⇒ CreateProcess → m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle, ReleaseKey) Source #

Create a process returning handles to stdin, stdout, and stderr as well as the process handle.

exec ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ExecConfigString → [String] → m String Source #

Execute a process, returning the stdout. Fail if the call returns +Hedgehog.Extras.Test.Process

hedgehog-extras-0.6.5.0: Supplemental library for hedgehog
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hedgehog.Extras.Test.Process

Synopsis

Documentation

createProcess ∷ (MonadTest m, MonadResource m, HasCallStack) ⇒ CreateProcess → m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle, ReleaseKey) Source #

Create a process returning handles to stdin, stdout, and stderr as well as the process handle.

exec ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ExecConfigString → [String] → m String Source #

Execute a process, returning the stdout. Fail if the call returns with a non-zero exit code. For a version that doesn't fail upon receiving a non-zero exit code, see execAny.

execAny Source #

Arguments

∷ (MonadTest m, MonadIO m, HasCallStack) 
ExecConfig 
String

The binary to launch

→ [String]

The binary's arguments

→ m (ExitCode, String, String)

exit code, stdout, stderr

Execute a process, returning the error code, the stdout, and the stderr.

exec_ ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ExecConfigString → [String] → m () Source #

Execute a process, returning ().

execFlex ∷ (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) ⇒ StringString → [String] → m String Source #

Create a process returning its stdout.

Being a flex function means that the environment determines how the process is launched.

When running in a nix environment, the envBin argument describes the environment variable that defines the binary to use to launch the process.

When running outside a nix environment, the pkgBin describes the name of the binary @@ -9,6 +9,6 @@ and an argument list.

The actual executable used will the one specified by the environment variable, but if the environment variable is not defined, it will be found instead by consulting the "plan.json" generated by cabal. It is assumed that the project has already been - configured and the executable has been built.

binFlex Source #

Arguments

∷ (MonadTest m, MonadIO m) 
String

Package name

String

Environment variable pointing to the binary to run

→ m FilePath

Path to executable

Compute the path to the binary given a package name or an environment variable override.

getProjectBase ∷ (MonadTest m, MonadIO m) ⇒ m String Source #

Compute the project base. This will be based on either the CARDANO_NODE_SRC + configured and the executable has been built.

binFlex Source #

Arguments

∷ (HasCallStack, MonadTest m, MonadIO m) 
String

Package name

String

Environment variable pointing to the binary to run

→ m FilePath

Path to executable

Compute the path to the binary given a package name or an environment variable override.

getProjectBase ∷ (MonadTest m, MonadIO m) ⇒ m String Source #

Compute the project base. This will be based on either the CARDANO_NODE_SRC environment variable or the first parent directory that contains the `cabal.project`. Both should point to the root directory of the Github project checkout.

waitForProcess ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m ExitCode Source #

Wait for process to exit.

maybeWaitForProcess ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m (Maybe ExitCode) Source #

Wait for process to exit or return Nothing if interrupted by an asynchronous exception.

getPid ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m (Maybe Pid) Source #

Get the process ID.

getPidOk ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m Pid Source #

Get the process ID.

waitSecondsForProcess ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ Int → ProcessHandle → m (Either TimedOut ExitCode) Source #

Wait a maximum of seconds secons for process to exit.

data ExecConfig Source #

Configuration for starting a new process. This is a subset of CreateProcess.

Instances

Instances details
Generic ExecConfig Source # 
Instance details

Defined in Hedgehog.Extras.Test.Process

Associated Types

type Rep ExecConfigTypeType Source #

Show ExecConfig Source # 
Instance details

Defined in Hedgehog.Extras.Test.Process

Eq ExecConfig Source # 
Instance details

Defined in Hedgehog.Extras.Test.Process

type Rep ExecConfig Source # 
Instance details

Defined in Hedgehog.Extras.Test.Process

type Rep ExecConfig = D1 ('MetaData "ExecConfig" "Hedgehog.Extras.Test.Process" "hedgehog-extras-0.6.5.0-inplace" 'False) (C1 ('MetaCons "ExecConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "execConfigEnv") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last [(String, String)])) :*: S1 ('MetaSel ('Just "execConfigCwd") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last FilePath))))
\ No newline at end of file diff --git a/hedgehog-extras/doc-index.json b/hedgehog-extras/doc-index.json index 97eebc39..f45b43bd 100644 --- a/hedgehog-extras/doc-index.json +++ b/hedgehog-extras/doc-index.json @@ -1 +1 @@ -[{"display_html":"goldenTestJsonValue ∷ ∀ a. Eq a ⇒ FromJSON a ⇒ Show a ⇒ ToJSON a ⇒ HasCallStack ⇒ a → FilePath → Property","name":"goldenTestJsonValue","module":"Hedgehog.Extras.Aeson","link":"Hedgehog-Extras-Aeson.html#v:goldenTestJsonValue"},{"display_html":"goldenTestJsonValuePretty ∷ ∀ a. Eq a ⇒ FromJSON a ⇒ HasCallStackShow a ⇒ ToJSON a ⇒ a → FilePath → Property","name":"goldenTestJsonValuePretty","module":"Hedgehog.Extras.Aeson","link":"Hedgehog-Extras-Aeson.html#v:goldenTestJsonValuePretty"},{"display_html":"argQuoteStringString","name":"argQuote","module":"Hedgehog.Extras.Internal.Cli","link":"Hedgehog-Extras-Internal-Cli.html#v:argQuote"},{"display_html":"newtype Plan = Plan {}","name":"Plan Plan installPlan","module":"Hedgehog.Extras.Internal.Plan","link":"Hedgehog-Extras-Internal-Plan.html#t:Plan"},{"display_html":"data Component = Component {}","name":"Component Component componentName binFile","module":"Hedgehog.Extras.Internal.Plan","link":"Hedgehog-Extras-Internal-Plan.html#t:Component"},{"display_html":"type Integration a = PropertyT (ReaderT IntegrationState (ResourceT IO)) a","name":"Integration","module":"Hedgehog.Extras.Internal.Test.Integration","link":"Hedgehog-Extras-Internal-Test-Integration.html#t:Integration"},{"display_html":"newtype IntegrationState = IntegrationState {}","name":"IntegrationState IntegrationState integrationStateFinals","module":"Hedgehog.Extras.Internal.Test.Integration","link":"Hedgehog-Extras-Internal-Test-Integration.html#t:IntegrationState"},{"display_html":"newIntegrationStateIOIO IntegrationState","name":"newIntegrationStateIO","module":"Hedgehog.Extras.Internal.Test.Integration","link":"Hedgehog-Extras-Internal-Test-Integration.html#v:newIntegrationStateIO"},{"display_html":"newIntegrationStateMMonadIO m ⇒ m IntegrationState","name":"newIntegrationStateM","module":"Hedgehog.Extras.Internal.Test.Integration","link":"Hedgehog-Extras-Internal-Test-Integration.html#v:newIntegrationStateM"},{"display_html":"runIntegrationReaderTMonadIO m ⇒ ReaderT IntegrationState m a → m a","name":"runIntegrationReaderT","module":"Hedgehog.Extras.Internal.Test.Integration","link":"Hedgehog-Extras-Internal-Test-Integration.html#v:runIntegrationReaderT"},{"display_html":"rewriteObject ∷ (KeyMap Value → KeyMap Value) → Value → Value","name":"rewriteObject","module":"Hedgehog.Extras.Stock.Aeson","link":"Hedgehog-Extras-Stock-Aeson.html#v:rewriteObject"},{"display_html":"rewriteArrayElements ∷ (Value → Value) → Value → Value","name":"rewriteArrayElements","module":"Hedgehog.Extras.Stock.Aeson","link":"Hedgehog-Extras-Stock-Aeson.html#v:rewriteArrayElements"},{"display_html":"callerModuleNameHasCallStackString","name":"callerModuleName","module":"Hedgehog.Extras.Stock.CallStack","link":"Hedgehog-Extras-Stock-CallStack.html#v:callerModuleName"},{"display_html":"fileContainsStringFilePathIO Bool","name":"fileContains","module":"Hedgehog.Extras.Stock.IO.File","link":"Hedgehog-Extras-Stock-IO-File.html#v:fileContains"},{"display_html":"doesNamedPipeExistFilePathIO Bool","name":"doesNamedPipeExist","module":"Hedgehog.Extras.Stock.IO.Network.NamedPipe","link":"Hedgehog-Extras-Stock-IO-Network-NamedPipe.html#v:doesNamedPipeExist"},{"display_html":"randomPortMonadIO m ⇒ MonadFail m ⇒ HostAddress → m PortNumber","name":"randomPort","module":"Hedgehog.Extras.Stock.IO.Network.Port","link":"Hedgehog-Extras-Stock-IO-Network-Port.html#v:randomPort"},{"display_html":"reserveRandomPortMonadFail m ⇒ MonadResource m ⇒ HostAddress → m (ReleaseKey, PortNumber)","name":"reserveRandomPort","module":"Hedgehog.Extras.Stock.IO.Network.Port","link":"Hedgehog-Extras-Stock-IO-Network-Port.html#v:reserveRandomPort"},{"display_html":"portInUseMonadIO m ⇒ HostAddress → PortNumber → m Bool","name":"portInUse","module":"Hedgehog.Extras.Stock.IO.Network.Port","link":"Hedgehog-Extras-Stock-IO-Network-Port.html#v:portInUse"},{"display_html":"doesSocketExistFilePathIO Bool","name":"doesSocketExist","module":"Hedgehog.Extras.Stock.IO.Network.Socket","link":"Hedgehog-Extras-Stock-IO-Network-Socket.html#v:doesSocketExist"},{"display_html":"isPortOpenIntIO Bool","name":"isPortOpen","module":"Hedgehog.Extras.Stock.IO.Network.Socket","link":"Hedgehog-Extras-Stock-IO-Network-Socket.html#v:isPortOpen"},{"display_html":"canConnect ∷ SockAddr → IO ()","name":"canConnect","module":"Hedgehog.Extras.Stock.IO.Network.Socket","link":"Hedgehog-Extras-Stock-IO-Network-Socket.html#v:canConnect"},{"display_html":"listenOnIntIO Socket","name":"listenOn","module":"Hedgehog.Extras.Stock.IO.Network.Socket","link":"Hedgehog-Extras-Stock-IO-Network-Socket.html#v:listenOn"},{"display_html":"allocateRandomPortsIntIO [Int]","name":"allocateRandomPorts","module":"Hedgehog.Extras.Stock.IO.Network.Socket","link":"Hedgehog-Extras-Stock-IO-Network-Socket.html#v:allocateRandomPorts"},{"display_html":"maybeWaitForProcess ∷ ProcessHandle → IO (Maybe ExitCode)","name":"maybeWaitForProcess","module":"Hedgehog.Extras.Stock.IO.Process","link":"Hedgehog-Extras-Stock-IO-Process.html#v:maybeWaitForProcess"},{"display_html":"waitSecondsForProcessInt → ProcessHandle → IO (Either TimedOut (Maybe ExitCode))","name":"waitSecondsForProcess","module":"Hedgehog.Extras.Stock.IO.Process","link":"Hedgehog-Extras-Stock-IO-Process.html#v:waitSecondsForProcess"},{"display_html":"data TimedOut = TimedOut","name":"TimedOut TimedOut","module":"Hedgehog.Extras.Stock.IO.Process","link":"Hedgehog-Extras-Stock-IO-Process.html#t:TimedOut"},{"display_html":"forceM ∷ (Monad m, NFData a) ⇒ m a → m a","name":"forceM","module":"Hedgehog.Extras.Stock.Monad","link":"Hedgehog-Extras-Stock-Monad.html#v:forceM"},{"display_html":"isWin32Bool","name":"isWin32","module":"Hedgehog.Extras.Stock.OS","link":"Hedgehog-Extras-Stock-OS.html#v:isWin32"},{"display_html":"data Sprocket = Sprocket {}","name":"Sprocket Sprocket sprocketBase sprocketName","module":"Hedgehog.Extras.Stock.IO.Network.Sprocket","link":"Hedgehog-Extras-Stock-IO-Network-Sprocket.html#t:Sprocket"},{"display_html":"doesSprocketExistSprocketIO Bool","name":"doesSprocketExist","module":"Hedgehog.Extras.Stock.IO.Network.Sprocket","link":"Hedgehog-Extras-Stock-IO-Network-Sprocket.html#v:doesSprocketExist"},{"display_html":"sprocketArgumentNameSprocketFilePath","name":"sprocketArgumentName","module":"Hedgehog.Extras.Stock.IO.Network.Sprocket","link":"Hedgehog-Extras-Stock-IO-Network-Sprocket.html#v:sprocketArgumentName"},{"display_html":"sprocketSystemNameSprocketFilePath","name":"sprocketSystemName","module":"Hedgehog.Extras.Stock.IO.Network.Sprocket","link":"Hedgehog-Extras-Stock-IO-Network-Sprocket.html#v:sprocketSystemName"},{"display_html":"maxSprocketArgumentNameLengthInt","name":"maxSprocketArgumentNameLength","module":"Hedgehog.Extras.Stock.IO.Network.Sprocket","link":"Hedgehog-Extras-Stock-IO-Network-Sprocket.html#v:maxSprocketArgumentNameLength"},{"display_html":"showUTCTimeSecondsUTCTimeString","name":"showUTCTimeSeconds","module":"Hedgehog.Extras.Stock.Time","link":"Hedgehog-Extras-Stock-Time.html#v:showUTCTimeSeconds"},{"display_html":"formatIso8601UTCTimeString","name":"formatIso8601","module":"Hedgehog.Extras.Stock.Time","link":"Hedgehog-Extras-Stock-Time.html#v:formatIso8601"},{"display_html":"threadDelay ∷ (HasCallStack, MonadTest m, MonadIO m) ⇒ Int → m ()","name":"threadDelay","module":"Hedgehog.Extras.Test.Concurrent","link":"Hedgehog-Extras-Test-Concurrent.html#v:threadDelay"},{"display_html":"asyncRegister_HasCallStack ⇒ MonadTest m ⇒ MonadResource m ⇒ MonadCatch m ⇒ IO a → m ()","name":"asyncRegister_","module":"Hedgehog.Extras.Test.Concurrent","link":"Hedgehog-Extras-Test-Concurrent.html#v:asyncRegister_"},{"display_html":"class Monad m ⇒ MonadAssertion m where","name":"MonadAssertion throwAssertion catchAssertion","module":"Hedgehog.Extras.Test.MonadAssertion","link":"Hedgehog-Extras-Test-MonadAssertion.html#t:MonadAssertion"},{"display_html":"propertyOnceHasCallStackIntegration () → Property","name":"propertyOnce","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:propertyOnce"},{"display_html":"workspace ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → (FilePath → m ()) → m ()","name":"workspace","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:workspace"},{"display_html":"moduleWorkspace ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ String → (FilePath → m ()) → m ()","name":"moduleWorkspace","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:moduleWorkspace"},{"display_html":"note ∷ (MonadTest m, HasCallStack) ⇒ String → m String","name":"note","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:note"},{"display_html":"note_ ∷ (MonadTest m, HasCallStack) ⇒ String → m ()","name":"note_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:note_"},{"display_html":"noteM ∷ (MonadTest m, MonadCatch m, HasCallStack) ⇒ m String → m String","name":"noteM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteM"},{"display_html":"noteM_ ∷ (MonadTest m, MonadCatch m, HasCallStack) ⇒ m String → m ()","name":"noteM_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteM_"},{"display_html":"noteIO ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IO String → m String","name":"noteIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteIO"},{"display_html":"noteIO_ ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IO String → m ()","name":"noteIO_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteIO_"},{"display_html":"noteShow ∷ (MonadTest m, HasCallStack, Show a) ⇒ a → m a","name":"noteShow","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShow"},{"display_html":"noteShowPretty ∷ (MonadTest m, HasCallStack, Show a) ⇒ a → m a","name":"noteShowPretty","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPretty"},{"display_html":"noteShowIO ∷ (MonadTest m, MonadIO m, HasCallStack, Show a) ⇒ IO a → m a","name":"noteShowIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowIO"},{"display_html":"noteShowPrettyIO ∷ (MonadTest m, MonadIO m, HasCallStack, Show a) ⇒ IO a → m a","name":"noteShowPrettyIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPrettyIO"},{"display_html":"noteShowIO_ ∷ (MonadTest m, MonadIO m, HasCallStack, Show a) ⇒ IO a → m ()","name":"noteShowIO_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowIO_"},{"display_html":"noteShowPrettyIO_ ∷ (MonadTest m, MonadIO m, HasCallStack, Show a) ⇒ IO a → m ()","name":"noteShowPrettyIO_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPrettyIO_"},{"display_html":"noteShowM ∷ (MonadTest m, MonadCatch m, HasCallStack, Show a) ⇒ m a → m a","name":"noteShowM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowM"},{"display_html":"noteShowPrettyM ∷ (MonadTest m, MonadCatch m, HasCallStack, Show a) ⇒ m a → m a","name":"noteShowPrettyM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPrettyM"},{"display_html":"noteShowM_ ∷ (MonadTest m, MonadCatch m, HasCallStack, Show a) ⇒ m a → m ()","name":"noteShowM_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowM_"},{"display_html":"noteShowPrettyM_ ∷ (MonadTest m, MonadCatch m, HasCallStack, Show a) ⇒ m a → m ()","name":"noteShowPrettyM_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPrettyM_"},{"display_html":"noteShow_ ∷ (MonadTest m, HasCallStack, Show a) ⇒ a → m ()","name":"noteShow_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShow_"},{"display_html":"noteShowPretty_ ∷ (MonadTest m, HasCallStack, Show a) ⇒ a → m ()","name":"noteShowPretty_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPretty_"},{"display_html":"noteEach ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ f a → m (f a)","name":"noteEach","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEach"},{"display_html":"noteEachPretty ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ f a → m (f a)","name":"noteEachPretty","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPretty"},{"display_html":"noteEachIO ∷ (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) ⇒ IO (f a) → m (f a)","name":"noteEachIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachIO"},{"display_html":"noteEachPrettyIO ∷ (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) ⇒ IO (f a) → m (f a)","name":"noteEachPrettyIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPrettyIO"},{"display_html":"noteEachIO_ ∷ (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) ⇒ IO (f a) → m ()","name":"noteEachIO_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachIO_"},{"display_html":"noteEachPrettyIO_ ∷ (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) ⇒ IO (f a) → m ()","name":"noteEachPrettyIO_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPrettyIO_"},{"display_html":"noteEachM ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m (f a)","name":"noteEachM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachM"},{"display_html":"noteEachPrettyM ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m (f a)","name":"noteEachPrettyM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPrettyM"},{"display_html":"noteEachM_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m ()","name":"noteEachM_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachM_"},{"display_html":"noteEachPrettyM_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m ()","name":"noteEachPrettyM_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPrettyM_"},{"display_html":"noteEach_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ f a → m ()","name":"noteEach_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEach_"},{"display_html":"noteEachPretty_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ f a → m ()","name":"noteEachPretty_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPretty_"},{"display_html":"noteTempFile ∷ (MonadTest m, HasCallStack) ⇒ FilePathFilePath → m FilePath","name":"noteTempFile","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteTempFile"},{"display_html":"headM ∷ (MonadTest m, HasCallStack) ⇒ [a] → m a","name":"headM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:headM"},{"display_html":"indexM ∷ (MonadTest m, HasCallStack) ⇒ Int → [a] → m a","name":"indexM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:indexM"},{"display_html":"fromJustM ∷ (MonadTest m, HasCallStack) ⇒ Maybe a → m a","name":"fromJustM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:fromJustM"},{"display_html":"nothingFail ∷ (MonadTest m, HasCallStack) ⇒ Maybe a → m a","name":"nothingFail","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:nothingFail"},{"display_html":"nothingFailM ∷ (MonadTest m, HasCallStack) ⇒ m (Maybe a) → m a","name":"nothingFailM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:nothingFailM"},{"display_html":"leftFail ∷ (MonadTest m, Show e, HasCallStack) ⇒ Either e a → m a","name":"leftFail","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:leftFail"},{"display_html":"leftFailM ∷ (MonadTest m, Show e, HasCallStack) ⇒ m (Either e a) → m a","name":"leftFailM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:leftFailM"},{"display_html":"onLeftMonad m ⇒ (e → m a) → m (Either e a) → m a","name":"onLeft","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:onLeft"},{"display_html":"onNothingMonad m ⇒ m a → m (Maybe a) → m a","name":"onNothing","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:onNothing"},{"display_html":"jsonErrorFail ∷ (MonadTest m, HasCallStack) ⇒ Result a → m a","name":"jsonErrorFail","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:jsonErrorFail"},{"display_html":"jsonErrorFailM ∷ (MonadTest m, HasCallStack) ⇒ m (Result a) → m a","name":"jsonErrorFailM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:jsonErrorFailM"},{"display_html":"failWithCustom ∷ MonadTest m ⇒ CallStackMaybe Diff → String → m a","name":"failWithCustom","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:failWithCustom"},{"display_html":"failMessage ∷ MonadTest m ⇒ CallStackString → m a","name":"failMessage","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:failMessage"},{"display_html":"assertByDeadlineM ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTime → m Bool → m ()","name":"assertByDeadlineM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertByDeadlineM"},{"display_html":"assertByDeadlineIO ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTimeIO Bool → m ()","name":"assertByDeadlineIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertByDeadlineIO"},{"display_html":"assertByDeadlineMFinally ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTime → m Bool → m () → m ()","name":"assertByDeadlineMFinally","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertByDeadlineMFinally"},{"display_html":"assertByDeadlineIOFinally ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTimeIO Bool → m () → m ()","name":"assertByDeadlineIOFinally","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertByDeadlineIOFinally"},{"display_html":"assertWith ∷ (MonadTest m, Show p, HasCallStack) ⇒ p → (p → Bool) → m ()","name":"assertWith","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertWith"},{"display_html":"assertWithM ∷ (MonadTest m, Show p, HasCallStack) ⇒ p → (p → m Bool) → m ()","name":"assertWithM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertWithM"},{"display_html":"assertM ∷ (MonadTest m, HasCallStack) ⇒ m Bool → m ()","name":"assertM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertM"},{"display_html":"assertIO ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IO Bool → m ()","name":"assertIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertIO"},{"display_html":"assertWithinTolerance ∷ (Show a, Ord a, Num a, HasCallStack, MonadTest m) ⇒ a → a → a → m ()","name":"assertWithinTolerance","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertWithinTolerance"},{"display_html":"byDeadlineM ∷ ∀ m a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeUTCTimeString → m a → m a","name":"byDeadlineM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:byDeadlineM"},{"display_html":"byDeadlineIO ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeUTCTimeStringIO a → m a","name":"byDeadlineIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:byDeadlineIO"},{"display_html":"byDurationM ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeNominalDiffTimeString → m a → m a","name":"byDurationM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:byDurationM"},{"display_html":"byDurationIO ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeNominalDiffTimeStringIO a → m a","name":"byDurationIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:byDurationIO"},{"display_html":"onFailureIntegration () → Integration ()","name":"onFailure","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:onFailure"},{"display_html":"type Integration a = PropertyT (ReaderT IntegrationState (ResourceT IO)) a","name":"Integration","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#t:Integration"},{"display_html":"release ∷ (MonadTest m, MonadIO m) ⇒ ReleaseKey → m ()","name":"release","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:release"},{"display_html":"runFinalliesIntegration a → Integration a","name":"runFinallies","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:runFinallies"},{"display_html":"retry ∷ ∀ a. Int → (IntIntegration a) → Integration a","name":"retry","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:retry"},{"display_html":"retry' ∷ ∀ a. IntIntegration a → Integration a","name":"retry'","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:retry-39-"},{"display_html":"createDirectoryIfMissing ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m FilePath","name":"createDirectoryIfMissing","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:createDirectoryIfMissing"},{"display_html":"createDirectoryIfMissing_ ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"createDirectoryIfMissing_","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:createDirectoryIfMissing_"},{"display_html":"createSubdirectoryIfMissingHasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ FilePathFilePath → m FilePath","name":"createSubdirectoryIfMissing","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:createSubdirectoryIfMissing"},{"display_html":"createSubdirectoryIfMissing_HasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ FilePathFilePath → m ()","name":"createSubdirectoryIfMissing_","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:createSubdirectoryIfMissing_"},{"display_html":"copyFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathFilePath → m ()","name":"copyFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:copyFile"},{"display_html":"renameFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathFilePath → m ()","name":"renameFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:renameFile"},{"display_html":"createFileLink ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathFilePath → m ()","name":"createFileLink","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:createFileLink"},{"display_html":"listDirectory ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m [FilePath]","name":"listDirectory","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:listDirectory"},{"display_html":"appendFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathString → m ()","name":"appendFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:appendFile"},{"display_html":"writeFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathString → m ()","name":"writeFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:writeFile"},{"display_html":"openFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathIOMode → m Handle","name":"openFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:openFile"},{"display_html":"readFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m String","name":"readFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:readFile"},{"display_html":"lbsWriteFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → ByteString → m ()","name":"lbsWriteFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:lbsWriteFile"},{"display_html":"lbsReadFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ByteString","name":"lbsReadFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:lbsReadFile"},{"display_html":"textWriteFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → Text → m ()","name":"textWriteFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:textWriteFile"},{"display_html":"textReadFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m Text","name":"textReadFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:textReadFile"},{"display_html":"copyRewriteJsonFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) ⇒ FilePathFilePath → (a → a) → m ()","name":"copyRewriteJsonFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:copyRewriteJsonFile"},{"display_html":"readJsonFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) ⇒ FilePath → m (Either String a)","name":"readJsonFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:readJsonFile"},{"display_html":"readJsonFileOk ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) ⇒ FilePath → m a","name":"readJsonFileOk","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:readJsonFileOk"},{"display_html":"rewriteJsonFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) ⇒ FilePath → (a → a) → m ()","name":"rewriteJsonFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:rewriteJsonFile"},{"display_html":"rewriteLbsJson ∷ ∀ a m. (MonadTest m, FromJSON a, ToJSON a, HasCallStack) ⇒ (a → a) → ByteString → m ByteString","name":"rewriteLbsJson","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:rewriteLbsJson"},{"display_html":"copyRewriteYamlFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) ⇒ FilePathFilePath → (a → a) → m ()","name":"copyRewriteYamlFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:copyRewriteYamlFile"},{"display_html":"readYamlFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) ⇒ FilePath → m (Either ParseException a)","name":"readYamlFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:readYamlFile"},{"display_html":"readYamlFileOk ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) ⇒ FilePath → m a","name":"readYamlFileOk","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:readYamlFileOk"},{"display_html":"rewriteYamlFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) ⇒ FilePath → (a → a) → m ()","name":"rewriteYamlFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:rewriteYamlFile"},{"display_html":"rewriteLbsYaml ∷ ∀ a m. (MonadTest m, FromJSON a, ToJSON a, HasCallStack) ⇒ (a → a) → ByteString → m ByteString","name":"rewriteLbsYaml","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:rewriteLbsYaml"},{"display_html":"cat ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"cat","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:cat"},{"display_html":"assertIsJsonFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertIsJsonFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertIsJsonFile"},{"display_html":"assertIsYamlFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertIsYamlFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertIsYamlFile"},{"display_html":"assertFileExists ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertFileExists","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFileExists"},{"display_html":"assertFilesExist ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ [FilePath] → m ()","name":"assertFilesExist","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFilesExist"},{"display_html":"assertFileMissing ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertFileMissing","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFileMissing"},{"display_html":"assertFilesMissing ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ [FilePath] → m ()","name":"assertFilesMissing","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFilesMissing"},{"display_html":"assertFileOccurences ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IntStringFilePath → m ()","name":"assertFileOccurences","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFileOccurences"},{"display_html":"assertFileLines ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ (IntBool) → FilePath → m ()","name":"assertFileLines","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFileLines"},{"display_html":"assertEndsWithSingleNewline ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertEndsWithSingleNewline","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertEndsWithSingleNewline"},{"display_html":"appendFileTimeDelta ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathUTCTime → m ()","name":"appendFileTimeDelta","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:appendFileTimeDelta"},{"display_html":"assertDirectoryMissing ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertDirectoryMissing","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertDirectoryMissing"},{"display_html":"assertDirectoryExists ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertDirectoryExists","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertDirectoryExists"},{"display_html":"stripStringString","name":"strip","module":"Hedgehog.Extras.Stock.String","link":"Hedgehog-Extras-Stock-String.html#v:strip"},{"display_html":"lastLineStringString","name":"lastLine","module":"Hedgehog.Extras.Stock.String","link":"Hedgehog-Extras-Stock-String.html#v:lastLine"},{"display_html":"firstLineStringString","name":"firstLine","module":"Hedgehog.Extras.Stock.String","link":"Hedgehog-Extras-Stock-String.html#v:firstLine"},{"display_html":"readNoteM ∷ (Read a, Show a, MonadTest m, MonadCatch m, HasCallStack) ⇒ String → m a","name":"readNoteM","module":"Hedgehog.Extras.Stock.String","link":"Hedgehog-Extras-Stock-String.html#v:readNoteM"},{"display_html":"module Hedgehog.Extras.Stock.Time","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.String","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.OS","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.Monad","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.IO.Process","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.IO.Network.Sprocket","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.IO.Network.Socket","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.IO.Network.NamedPipe","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.IO.File","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.CallStack","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.Aeson","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"doesFileExists ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m Bool","name":"doesFileExists","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:doesFileExists"},{"display_html":"isPortOpen ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ Int → m Bool","name":"isPortOpen","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:isPortOpen"},{"display_html":"doesSocketExist ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m Bool","name":"doesSocketExist","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:doesSocketExist"},{"display_html":"assertPortOpen ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ Int → m ()","name":"assertPortOpen","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:assertPortOpen"},{"display_html":"assertSocketExists ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertSocketExists","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:assertSocketExists"},{"display_html":"doesSprocketExist ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ Sprocket → m Bool","name":"doesSprocketExist","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:doesSprocketExist"},{"display_html":"downloadToFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ StringFilePath → m ()","name":"downloadToFile","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:downloadToFile"},{"display_html":"downloadAndExtractGithubCommitToTemp ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathStringString → m FilePath","name":"downloadAndExtractGithubCommitToTemp","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:downloadAndExtractGithubCommitToTemp"},{"display_html":"createProcess ∷ (MonadTest m, MonadResource m, HasCallStack) ⇒ CreateProcess → m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle, ReleaseKey)","name":"createProcess","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:createProcess"},{"display_html":"exec ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ExecConfigString → [String] → m String","name":"exec","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:exec"},{"display_html":"execAny ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ExecConfigString → [String] → m (ExitCode, String, String)","name":"execAny","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:execAny"},{"display_html":"exec_ ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ExecConfigString → [String] → m ()","name":"exec_","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:exec_"},{"display_html":"execFlex ∷ (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) ⇒ StringString → [String] → m String","name":"execFlex","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:execFlex"},{"display_html":"execFlex' ∷ (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) ⇒ ExecConfigStringString → [String] → m String","name":"execFlex'","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:execFlex-39-"},{"display_html":"execFlexAny' ∷ (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) ⇒ ExecConfigStringString → [String] → m (ExitCode, String, String)","name":"execFlexAny'","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:execFlexAny-39-"},{"display_html":"procFlex ∷ (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) ⇒ StringString → [String] → m CreateProcess","name":"procFlex","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:procFlex"},{"display_html":"binFlex ∷ (MonadTest m, MonadIO m) ⇒ StringString → m FilePath","name":"binFlex","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:binFlex"},{"display_html":"getProjectBase ∷ (MonadTest m, MonadIO m) ⇒ m String","name":"getProjectBase","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:getProjectBase"},{"display_html":"waitForProcess ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m ExitCode","name":"waitForProcess","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:waitForProcess"},{"display_html":"maybeWaitForProcess ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m (Maybe ExitCode)","name":"maybeWaitForProcess","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:maybeWaitForProcess"},{"display_html":"getPid ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m (Maybe Pid)","name":"getPid","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:getPid"},{"display_html":"getPidOk ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m Pid","name":"getPidOk","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:getPidOk"},{"display_html":"waitSecondsForProcess ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ Int → ProcessHandle → m (Either TimedOut ExitCode)","name":"waitSecondsForProcess","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:waitSecondsForProcess"},{"display_html":"data ExecConfig = ExecConfig {}","name":"ExecConfig ExecConfig execConfigEnv execConfigCwd","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#t:ExecConfig"},{"display_html":"defaultExecConfigExecConfig","name":"defaultExecConfig","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:defaultExecConfig"},{"display_html":"runWithWatchdog_HasCallStack ⇒ MonadBaseControl IO m ⇒ WatchdogConfig → (HasCallStack ⇒ m a) → m a","name":"runWithWatchdog_","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:runWithWatchdog_"},{"display_html":"runWithWatchdogHasCallStack ⇒ MonadBaseControl IO m ⇒ WatchdogConfig → (HasCallStackWatchdog → m a) → m a","name":"runWithWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:runWithWatchdog"},{"display_html":"runWithDefaultWatchdog_HasCallStack ⇒ MonadBaseControl IO m ⇒ (HasCallStack ⇒ m a) → m a","name":"runWithDefaultWatchdog_","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:runWithDefaultWatchdog_"},{"display_html":"runWithDefaultWatchdogHasCallStack ⇒ MonadBaseControl IO m ⇒ (HasCallStackWatchdog → m a) → m a","name":"runWithDefaultWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:runWithDefaultWatchdog"},{"display_html":"kickWatchdogMonadIO m ⇒ Watchdog → m ()","name":"kickWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:kickWatchdog"},{"display_html":"poisonWatchdogMonadIO m ⇒ Watchdog → m ()","name":"poisonWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:poisonWatchdog"},{"display_html":"data Watchdog","name":"Watchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#t:Watchdog"},{"display_html":"newtype WatchdogConfig = WatchdogConfig {}","name":"WatchdogConfig WatchdogConfig watchdogTimeout","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#t:WatchdogConfig"},{"display_html":"newtype WatchdogException = WatchdogException {}","name":"WatchdogException WatchdogException timeElapsed","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#t:WatchdogException"},{"display_html":"makeWatchdog ∷ MonadBase IO m ⇒ WatchdogConfigThreadId → m Watchdog","name":"makeWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:makeWatchdog"},{"display_html":"runWatchdog ∷ MonadBase IO m ⇒ Watchdog → m ()","name":"runWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:runWatchdog"},{"display_html":"data Tripwire","name":"Tripwire","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#t:Tripwire"},{"display_html":"makeTripwireMonadIO m ⇒ m Tripwire","name":"makeTripwire","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:makeTripwire"},{"display_html":"makeTripwireWithLabelMonadIO m ⇒ String → m Tripwire","name":"makeTripwireWithLabel","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:makeTripwireWithLabel"},{"display_html":"tripHasCallStackMonadIO m ⇒ MonadTest m ⇒ Tripwire → m ()","name":"trip","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:trip"},{"display_html":"trip_HasCallStackMonadIO m ⇒ Tripwire → m ()","name":"trip_","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:trip_"},{"display_html":"isTrippedMonadIO m ⇒ Tripwire → m Bool","name":"isTripped","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:isTripped"},{"display_html":"getTripSiteMonadIO m ⇒ Tripwire → m (Maybe CallStack)","name":"getTripSite","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:getTripSite"},{"display_html":"resetTripwireMonadIO m ⇒ Tripwire → m ()","name":"resetTripwire","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:resetTripwire"},{"display_html":"assertNotTrippedHasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ Tripwire → m ()","name":"assertNotTripped","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:assertNotTripped"},{"display_html":"assertTrippedHasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ Tripwire → m ()","name":"assertTripped","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:assertTripped"},{"display_html":"module Hedgehog.Extras.Test.Tripwire","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.TestWatchdog","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.Process","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.Network","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.MonadAssertion","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.File","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.Concurrent","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.Base","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"diffVsGoldenFileHasCallStack ⇒ (MonadIO m, MonadTest m) ⇒ StringFilePath → m ()","name":"diffVsGoldenFile","module":"Hedgehog.Extras.Test.Golden","link":"Hedgehog-Extras-Test-Golden.html#v:diffVsGoldenFile"},{"display_html":"diffFileVsGoldenFileHasCallStack ⇒ (MonadIO m, MonadTest m) ⇒ FilePathFilePath → m ()","name":"diffFileVsGoldenFile","module":"Hedgehog.Extras.Test.Golden","link":"Hedgehog-Extras-Test-Golden.html#v:diffFileVsGoldenFile"},{"display_html":"module Hedgehog.Extras.Test","name":"","module":"Hedgehog.Extras","link":""}] \ No newline at end of file +[{"display_html":"goldenTestJsonValue ∷ ∀ a. Eq a ⇒ FromJSON a ⇒ Show a ⇒ ToJSON a ⇒ HasCallStack ⇒ a → FilePath → Property","name":"goldenTestJsonValue","module":"Hedgehog.Extras.Aeson","link":"Hedgehog-Extras-Aeson.html#v:goldenTestJsonValue"},{"display_html":"goldenTestJsonValuePretty ∷ ∀ a. Eq a ⇒ FromJSON a ⇒ HasCallStackShow a ⇒ ToJSON a ⇒ a → FilePath → Property","name":"goldenTestJsonValuePretty","module":"Hedgehog.Extras.Aeson","link":"Hedgehog-Extras-Aeson.html#v:goldenTestJsonValuePretty"},{"display_html":"argQuoteStringString","name":"argQuote","module":"Hedgehog.Extras.Internal.Cli","link":"Hedgehog-Extras-Internal-Cli.html#v:argQuote"},{"display_html":"newtype Plan = Plan {}","name":"Plan Plan installPlan","module":"Hedgehog.Extras.Internal.Plan","link":"Hedgehog-Extras-Internal-Plan.html#t:Plan"},{"display_html":"data Component = Component {}","name":"Component Component componentName binFile","module":"Hedgehog.Extras.Internal.Plan","link":"Hedgehog-Extras-Internal-Plan.html#t:Component"},{"display_html":"type Integration a = PropertyT (ReaderT IntegrationState (ResourceT IO)) a","name":"Integration","module":"Hedgehog.Extras.Internal.Test.Integration","link":"Hedgehog-Extras-Internal-Test-Integration.html#t:Integration"},{"display_html":"newtype IntegrationState = IntegrationState {}","name":"IntegrationState IntegrationState integrationStateFinals","module":"Hedgehog.Extras.Internal.Test.Integration","link":"Hedgehog-Extras-Internal-Test-Integration.html#t:IntegrationState"},{"display_html":"newIntegrationStateIOIO IntegrationState","name":"newIntegrationStateIO","module":"Hedgehog.Extras.Internal.Test.Integration","link":"Hedgehog-Extras-Internal-Test-Integration.html#v:newIntegrationStateIO"},{"display_html":"newIntegrationStateMMonadIO m ⇒ m IntegrationState","name":"newIntegrationStateM","module":"Hedgehog.Extras.Internal.Test.Integration","link":"Hedgehog-Extras-Internal-Test-Integration.html#v:newIntegrationStateM"},{"display_html":"runIntegrationReaderTMonadIO m ⇒ ReaderT IntegrationState m a → m a","name":"runIntegrationReaderT","module":"Hedgehog.Extras.Internal.Test.Integration","link":"Hedgehog-Extras-Internal-Test-Integration.html#v:runIntegrationReaderT"},{"display_html":"rewriteObject ∷ (KeyMap Value → KeyMap Value) → Value → Value","name":"rewriteObject","module":"Hedgehog.Extras.Stock.Aeson","link":"Hedgehog-Extras-Stock-Aeson.html#v:rewriteObject"},{"display_html":"rewriteArrayElements ∷ (Value → Value) → Value → Value","name":"rewriteArrayElements","module":"Hedgehog.Extras.Stock.Aeson","link":"Hedgehog-Extras-Stock-Aeson.html#v:rewriteArrayElements"},{"display_html":"callerModuleNameHasCallStackString","name":"callerModuleName","module":"Hedgehog.Extras.Stock.CallStack","link":"Hedgehog-Extras-Stock-CallStack.html#v:callerModuleName"},{"display_html":"fileContainsStringFilePathIO Bool","name":"fileContains","module":"Hedgehog.Extras.Stock.IO.File","link":"Hedgehog-Extras-Stock-IO-File.html#v:fileContains"},{"display_html":"doesNamedPipeExistFilePathIO Bool","name":"doesNamedPipeExist","module":"Hedgehog.Extras.Stock.IO.Network.NamedPipe","link":"Hedgehog-Extras-Stock-IO-Network-NamedPipe.html#v:doesNamedPipeExist"},{"display_html":"randomPortMonadIO m ⇒ MonadFail m ⇒ HostAddress → m PortNumber","name":"randomPort","module":"Hedgehog.Extras.Stock.IO.Network.Port","link":"Hedgehog-Extras-Stock-IO-Network-Port.html#v:randomPort"},{"display_html":"reserveRandomPortMonadFail m ⇒ MonadResource m ⇒ HostAddress → m (ReleaseKey, PortNumber)","name":"reserveRandomPort","module":"Hedgehog.Extras.Stock.IO.Network.Port","link":"Hedgehog-Extras-Stock-IO-Network-Port.html#v:reserveRandomPort"},{"display_html":"portInUseMonadIO m ⇒ HostAddress → PortNumber → m Bool","name":"portInUse","module":"Hedgehog.Extras.Stock.IO.Network.Port","link":"Hedgehog-Extras-Stock-IO-Network-Port.html#v:portInUse"},{"display_html":"doesSocketExistFilePathIO Bool","name":"doesSocketExist","module":"Hedgehog.Extras.Stock.IO.Network.Socket","link":"Hedgehog-Extras-Stock-IO-Network-Socket.html#v:doesSocketExist"},{"display_html":"isPortOpenIntIO Bool","name":"isPortOpen","module":"Hedgehog.Extras.Stock.IO.Network.Socket","link":"Hedgehog-Extras-Stock-IO-Network-Socket.html#v:isPortOpen"},{"display_html":"canConnect ∷ SockAddr → IO ()","name":"canConnect","module":"Hedgehog.Extras.Stock.IO.Network.Socket","link":"Hedgehog-Extras-Stock-IO-Network-Socket.html#v:canConnect"},{"display_html":"listenOnIntIO Socket","name":"listenOn","module":"Hedgehog.Extras.Stock.IO.Network.Socket","link":"Hedgehog-Extras-Stock-IO-Network-Socket.html#v:listenOn"},{"display_html":"allocateRandomPortsIntIO [Int]","name":"allocateRandomPorts","module":"Hedgehog.Extras.Stock.IO.Network.Socket","link":"Hedgehog-Extras-Stock-IO-Network-Socket.html#v:allocateRandomPorts"},{"display_html":"maybeWaitForProcess ∷ ProcessHandle → IO (Maybe ExitCode)","name":"maybeWaitForProcess","module":"Hedgehog.Extras.Stock.IO.Process","link":"Hedgehog-Extras-Stock-IO-Process.html#v:maybeWaitForProcess"},{"display_html":"waitSecondsForProcessInt → ProcessHandle → IO (Either TimedOut (Maybe ExitCode))","name":"waitSecondsForProcess","module":"Hedgehog.Extras.Stock.IO.Process","link":"Hedgehog-Extras-Stock-IO-Process.html#v:waitSecondsForProcess"},{"display_html":"data TimedOut = TimedOut","name":"TimedOut TimedOut","module":"Hedgehog.Extras.Stock.IO.Process","link":"Hedgehog-Extras-Stock-IO-Process.html#t:TimedOut"},{"display_html":"forceM ∷ (Monad m, NFData a) ⇒ m a → m a","name":"forceM","module":"Hedgehog.Extras.Stock.Monad","link":"Hedgehog-Extras-Stock-Monad.html#v:forceM"},{"display_html":"isWin32Bool","name":"isWin32","module":"Hedgehog.Extras.Stock.OS","link":"Hedgehog-Extras-Stock-OS.html#v:isWin32"},{"display_html":"data Sprocket = Sprocket {}","name":"Sprocket Sprocket sprocketBase sprocketName","module":"Hedgehog.Extras.Stock.IO.Network.Sprocket","link":"Hedgehog-Extras-Stock-IO-Network-Sprocket.html#t:Sprocket"},{"display_html":"doesSprocketExistSprocketIO Bool","name":"doesSprocketExist","module":"Hedgehog.Extras.Stock.IO.Network.Sprocket","link":"Hedgehog-Extras-Stock-IO-Network-Sprocket.html#v:doesSprocketExist"},{"display_html":"sprocketArgumentNameSprocketFilePath","name":"sprocketArgumentName","module":"Hedgehog.Extras.Stock.IO.Network.Sprocket","link":"Hedgehog-Extras-Stock-IO-Network-Sprocket.html#v:sprocketArgumentName"},{"display_html":"sprocketSystemNameSprocketFilePath","name":"sprocketSystemName","module":"Hedgehog.Extras.Stock.IO.Network.Sprocket","link":"Hedgehog-Extras-Stock-IO-Network-Sprocket.html#v:sprocketSystemName"},{"display_html":"maxSprocketArgumentNameLengthInt","name":"maxSprocketArgumentNameLength","module":"Hedgehog.Extras.Stock.IO.Network.Sprocket","link":"Hedgehog-Extras-Stock-IO-Network-Sprocket.html#v:maxSprocketArgumentNameLength"},{"display_html":"showUTCTimeSecondsUTCTimeString","name":"showUTCTimeSeconds","module":"Hedgehog.Extras.Stock.Time","link":"Hedgehog-Extras-Stock-Time.html#v:showUTCTimeSeconds"},{"display_html":"formatIso8601UTCTimeString","name":"formatIso8601","module":"Hedgehog.Extras.Stock.Time","link":"Hedgehog-Extras-Stock-Time.html#v:formatIso8601"},{"display_html":"threadDelay ∷ (HasCallStack, MonadTest m, MonadIO m) ⇒ Int → m ()","name":"threadDelay","module":"Hedgehog.Extras.Test.Concurrent","link":"Hedgehog-Extras-Test-Concurrent.html#v:threadDelay"},{"display_html":"asyncRegister_HasCallStack ⇒ MonadTest m ⇒ MonadResource m ⇒ MonadCatch m ⇒ IO a → m ()","name":"asyncRegister_","module":"Hedgehog.Extras.Test.Concurrent","link":"Hedgehog-Extras-Test-Concurrent.html#v:asyncRegister_"},{"display_html":"class Monad m ⇒ MonadAssertion m where","name":"MonadAssertion throwAssertion catchAssertion","module":"Hedgehog.Extras.Test.MonadAssertion","link":"Hedgehog-Extras-Test-MonadAssertion.html#t:MonadAssertion"},{"display_html":"propertyOnceHasCallStackIntegration () → Property","name":"propertyOnce","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:propertyOnce"},{"display_html":"workspace ∷ MonadTest m ⇒ HasCallStack ⇒ MonadResource m ⇒ FilePath → (FilePath → m ()) → m ()","name":"workspace","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:workspace"},{"display_html":"moduleWorkspace ∷ (MonadTest m, MonadResource m, HasCallStack) ⇒ String → (FilePath → m ()) → m ()","name":"moduleWorkspace","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:moduleWorkspace"},{"display_html":"note ∷ (MonadTest m, HasCallStack) ⇒ String → m String","name":"note","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:note"},{"display_html":"note_ ∷ (MonadTest m, HasCallStack) ⇒ String → m ()","name":"note_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:note_"},{"display_html":"noteM ∷ (MonadTest m, MonadCatch m, HasCallStack) ⇒ m String → m String","name":"noteM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteM"},{"display_html":"noteM_ ∷ (MonadTest m, MonadCatch m, HasCallStack) ⇒ m String → m ()","name":"noteM_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteM_"},{"display_html":"noteIO ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IO String → m String","name":"noteIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteIO"},{"display_html":"noteIO_ ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IO String → m ()","name":"noteIO_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteIO_"},{"display_html":"noteShow ∷ (MonadTest m, HasCallStack, Show a) ⇒ a → m a","name":"noteShow","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShow"},{"display_html":"noteShowPretty ∷ (MonadTest m, HasCallStack, Show a) ⇒ a → m a","name":"noteShowPretty","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPretty"},{"display_html":"noteShowIO ∷ (MonadTest m, MonadIO m, HasCallStack, Show a) ⇒ IO a → m a","name":"noteShowIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowIO"},{"display_html":"noteShowPrettyIO ∷ (MonadTest m, MonadIO m, HasCallStack, Show a) ⇒ IO a → m a","name":"noteShowPrettyIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPrettyIO"},{"display_html":"noteShowIO_ ∷ (MonadTest m, MonadIO m, HasCallStack, Show a) ⇒ IO a → m ()","name":"noteShowIO_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowIO_"},{"display_html":"noteShowPrettyIO_ ∷ (MonadTest m, MonadIO m, HasCallStack, Show a) ⇒ IO a → m ()","name":"noteShowPrettyIO_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPrettyIO_"},{"display_html":"noteShowM ∷ (MonadTest m, MonadCatch m, HasCallStack, Show a) ⇒ m a → m a","name":"noteShowM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowM"},{"display_html":"noteShowPrettyM ∷ (MonadTest m, MonadCatch m, HasCallStack, Show a) ⇒ m a → m a","name":"noteShowPrettyM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPrettyM"},{"display_html":"noteShowM_ ∷ (MonadTest m, MonadCatch m, HasCallStack, Show a) ⇒ m a → m ()","name":"noteShowM_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowM_"},{"display_html":"noteShowPrettyM_ ∷ (MonadTest m, MonadCatch m, HasCallStack, Show a) ⇒ m a → m ()","name":"noteShowPrettyM_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPrettyM_"},{"display_html":"noteShow_ ∷ (MonadTest m, HasCallStack, Show a) ⇒ a → m ()","name":"noteShow_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShow_"},{"display_html":"noteShowPretty_ ∷ (MonadTest m, HasCallStack, Show a) ⇒ a → m ()","name":"noteShowPretty_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteShowPretty_"},{"display_html":"noteEach ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ f a → m (f a)","name":"noteEach","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEach"},{"display_html":"noteEachPretty ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ f a → m (f a)","name":"noteEachPretty","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPretty"},{"display_html":"noteEachIO ∷ (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) ⇒ IO (f a) → m (f a)","name":"noteEachIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachIO"},{"display_html":"noteEachPrettyIO ∷ (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) ⇒ IO (f a) → m (f a)","name":"noteEachPrettyIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPrettyIO"},{"display_html":"noteEachIO_ ∷ (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) ⇒ IO (f a) → m ()","name":"noteEachIO_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachIO_"},{"display_html":"noteEachPrettyIO_ ∷ (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) ⇒ IO (f a) → m ()","name":"noteEachPrettyIO_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPrettyIO_"},{"display_html":"noteEachM ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m (f a)","name":"noteEachM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachM"},{"display_html":"noteEachPrettyM ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m (f a)","name":"noteEachPrettyM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPrettyM"},{"display_html":"noteEachM_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m ()","name":"noteEachM_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachM_"},{"display_html":"noteEachPrettyM_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ m (f a) → m ()","name":"noteEachPrettyM_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPrettyM_"},{"display_html":"noteEach_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ f a → m ()","name":"noteEach_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEach_"},{"display_html":"noteEachPretty_ ∷ (MonadTest m, HasCallStack, Show a, Traversable f) ⇒ f a → m ()","name":"noteEachPretty_","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteEachPretty_"},{"display_html":"noteTempFile ∷ (MonadTest m, HasCallStack) ⇒ FilePathFilePath → m FilePath","name":"noteTempFile","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:noteTempFile"},{"display_html":"headM ∷ (MonadTest m, HasCallStack) ⇒ [a] → m a","name":"headM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:headM"},{"display_html":"indexM ∷ (MonadTest m, HasCallStack) ⇒ Int → [a] → m a","name":"indexM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:indexM"},{"display_html":"fromJustM ∷ (MonadTest m, HasCallStack) ⇒ Maybe a → m a","name":"fromJustM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:fromJustM"},{"display_html":"nothingFail ∷ (MonadTest m, HasCallStack) ⇒ Maybe a → m a","name":"nothingFail","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:nothingFail"},{"display_html":"nothingFailM ∷ (MonadTest m, HasCallStack) ⇒ m (Maybe a) → m a","name":"nothingFailM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:nothingFailM"},{"display_html":"leftFail ∷ (MonadTest m, Show e, HasCallStack) ⇒ Either e a → m a","name":"leftFail","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:leftFail"},{"display_html":"leftFailM ∷ (MonadTest m, Show e, HasCallStack) ⇒ m (Either e a) → m a","name":"leftFailM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:leftFailM"},{"display_html":"onLeftMonad m ⇒ (e → m a) → m (Either e a) → m a","name":"onLeft","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:onLeft"},{"display_html":"onNothingMonad m ⇒ m a → m (Maybe a) → m a","name":"onNothing","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:onNothing"},{"display_html":"jsonErrorFail ∷ (MonadTest m, HasCallStack) ⇒ Result a → m a","name":"jsonErrorFail","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:jsonErrorFail"},{"display_html":"jsonErrorFailM ∷ (MonadTest m, HasCallStack) ⇒ m (Result a) → m a","name":"jsonErrorFailM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:jsonErrorFailM"},{"display_html":"failWithCustom ∷ MonadTest m ⇒ CallStackMaybe Diff → String → m a","name":"failWithCustom","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:failWithCustom"},{"display_html":"failMessage ∷ MonadTest m ⇒ CallStackString → m a","name":"failMessage","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:failMessage"},{"display_html":"assertByDeadlineM ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTime → m Bool → m ()","name":"assertByDeadlineM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertByDeadlineM"},{"display_html":"assertByDeadlineIO ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTimeIO Bool → m ()","name":"assertByDeadlineIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertByDeadlineIO"},{"display_html":"assertByDeadlineMFinally ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTime → m Bool → m () → m ()","name":"assertByDeadlineMFinally","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertByDeadlineMFinally"},{"display_html":"assertByDeadlineIOFinally ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ UTCTimeIO Bool → m () → m ()","name":"assertByDeadlineIOFinally","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertByDeadlineIOFinally"},{"display_html":"assertWith ∷ (MonadTest m, Show p, HasCallStack) ⇒ p → (p → Bool) → m ()","name":"assertWith","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertWith"},{"display_html":"assertWithM ∷ (MonadTest m, Show p, HasCallStack) ⇒ p → (p → m Bool) → m ()","name":"assertWithM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertWithM"},{"display_html":"assertM ∷ (MonadTest m, HasCallStack) ⇒ m Bool → m ()","name":"assertM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertM"},{"display_html":"assertIO ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IO Bool → m ()","name":"assertIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertIO"},{"display_html":"assertWithinTolerance ∷ (Show a, Ord a, Num a, HasCallStack, MonadTest m) ⇒ a → a → a → m ()","name":"assertWithinTolerance","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:assertWithinTolerance"},{"display_html":"byDeadlineM ∷ ∀ m a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeUTCTimeString → m a → m a","name":"byDeadlineM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:byDeadlineM"},{"display_html":"byDeadlineIO ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeUTCTimeStringIO a → m a","name":"byDeadlineIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:byDeadlineIO"},{"display_html":"byDurationM ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeNominalDiffTimeString → m a → m a","name":"byDurationM","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:byDurationM"},{"display_html":"byDurationIO ∷ (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) ⇒ NominalDiffTimeNominalDiffTimeStringIO a → m a","name":"byDurationIO","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:byDurationIO"},{"display_html":"onFailureIntegration () → Integration ()","name":"onFailure","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:onFailure"},{"display_html":"type Integration a = PropertyT (ReaderT IntegrationState (ResourceT IO)) a","name":"Integration","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#t:Integration"},{"display_html":"release ∷ (MonadTest m, MonadIO m) ⇒ ReleaseKey → m ()","name":"release","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:release"},{"display_html":"runFinalliesIntegration a → Integration a","name":"runFinallies","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:runFinallies"},{"display_html":"retry ∷ ∀ a. Int → (IntIntegration a) → Integration a","name":"retry","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:retry"},{"display_html":"retry' ∷ ∀ a. IntIntegration a → Integration a","name":"retry'","module":"Hedgehog.Extras.Test.Base","link":"Hedgehog-Extras-Test-Base.html#v:retry-39-"},{"display_html":"createDirectoryIfMissing ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m FilePath","name":"createDirectoryIfMissing","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:createDirectoryIfMissing"},{"display_html":"createDirectoryIfMissing_ ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"createDirectoryIfMissing_","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:createDirectoryIfMissing_"},{"display_html":"createSubdirectoryIfMissingHasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ FilePathFilePath → m FilePath","name":"createSubdirectoryIfMissing","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:createSubdirectoryIfMissing"},{"display_html":"createSubdirectoryIfMissing_HasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ FilePathFilePath → m ()","name":"createSubdirectoryIfMissing_","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:createSubdirectoryIfMissing_"},{"display_html":"copyFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathFilePath → m ()","name":"copyFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:copyFile"},{"display_html":"renameFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathFilePath → m ()","name":"renameFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:renameFile"},{"display_html":"createFileLink ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathFilePath → m ()","name":"createFileLink","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:createFileLink"},{"display_html":"listDirectory ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m [FilePath]","name":"listDirectory","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:listDirectory"},{"display_html":"appendFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathString → m ()","name":"appendFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:appendFile"},{"display_html":"writeFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathString → m ()","name":"writeFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:writeFile"},{"display_html":"openFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathIOMode → m Handle","name":"openFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:openFile"},{"display_html":"readFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m String","name":"readFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:readFile"},{"display_html":"lbsWriteFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → ByteString → m ()","name":"lbsWriteFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:lbsWriteFile"},{"display_html":"lbsReadFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ByteString","name":"lbsReadFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:lbsReadFile"},{"display_html":"textWriteFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → Text → m ()","name":"textWriteFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:textWriteFile"},{"display_html":"textReadFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m Text","name":"textReadFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:textReadFile"},{"display_html":"copyRewriteJsonFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) ⇒ FilePathFilePath → (a → a) → m ()","name":"copyRewriteJsonFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:copyRewriteJsonFile"},{"display_html":"readJsonFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) ⇒ FilePath → m (Either String a)","name":"readJsonFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:readJsonFile"},{"display_html":"readJsonFileOk ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) ⇒ FilePath → m a","name":"readJsonFileOk","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:readJsonFileOk"},{"display_html":"rewriteJsonFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) ⇒ FilePath → (a → a) → m ()","name":"rewriteJsonFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:rewriteJsonFile"},{"display_html":"rewriteLbsJson ∷ ∀ a m. (MonadTest m, FromJSON a, ToJSON a, HasCallStack) ⇒ (a → a) → ByteString → m ByteString","name":"rewriteLbsJson","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:rewriteLbsJson"},{"display_html":"copyRewriteYamlFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) ⇒ FilePathFilePath → (a → a) → m ()","name":"copyRewriteYamlFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:copyRewriteYamlFile"},{"display_html":"readYamlFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) ⇒ FilePath → m (Either ParseException a)","name":"readYamlFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:readYamlFile"},{"display_html":"readYamlFileOk ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, HasCallStack) ⇒ FilePath → m a","name":"readYamlFileOk","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:readYamlFileOk"},{"display_html":"rewriteYamlFile ∷ ∀ a m. (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) ⇒ FilePath → (a → a) → m ()","name":"rewriteYamlFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:rewriteYamlFile"},{"display_html":"rewriteLbsYaml ∷ ∀ a m. (MonadTest m, FromJSON a, ToJSON a, HasCallStack) ⇒ (a → a) → ByteString → m ByteString","name":"rewriteLbsYaml","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:rewriteLbsYaml"},{"display_html":"cat ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"cat","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:cat"},{"display_html":"assertIsJsonFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertIsJsonFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertIsJsonFile"},{"display_html":"assertIsYamlFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertIsYamlFile","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertIsYamlFile"},{"display_html":"assertFileExists ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertFileExists","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFileExists"},{"display_html":"assertFilesExist ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ [FilePath] → m ()","name":"assertFilesExist","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFilesExist"},{"display_html":"assertFileMissing ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertFileMissing","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFileMissing"},{"display_html":"assertFilesMissing ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ [FilePath] → m ()","name":"assertFilesMissing","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFilesMissing"},{"display_html":"assertFileOccurences ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ IntStringFilePath → m ()","name":"assertFileOccurences","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFileOccurences"},{"display_html":"assertFileLines ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ (IntBool) → FilePath → m ()","name":"assertFileLines","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertFileLines"},{"display_html":"assertEndsWithSingleNewline ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertEndsWithSingleNewline","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertEndsWithSingleNewline"},{"display_html":"appendFileTimeDelta ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathUTCTime → m ()","name":"appendFileTimeDelta","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:appendFileTimeDelta"},{"display_html":"assertDirectoryMissing ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertDirectoryMissing","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertDirectoryMissing"},{"display_html":"assertDirectoryExists ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertDirectoryExists","module":"Hedgehog.Extras.Test.File","link":"Hedgehog-Extras-Test-File.html#v:assertDirectoryExists"},{"display_html":"stripStringString","name":"strip","module":"Hedgehog.Extras.Stock.String","link":"Hedgehog-Extras-Stock-String.html#v:strip"},{"display_html":"lastLineStringString","name":"lastLine","module":"Hedgehog.Extras.Stock.String","link":"Hedgehog-Extras-Stock-String.html#v:lastLine"},{"display_html":"firstLineStringString","name":"firstLine","module":"Hedgehog.Extras.Stock.String","link":"Hedgehog-Extras-Stock-String.html#v:firstLine"},{"display_html":"readNoteM ∷ (Read a, Show a, MonadTest m, MonadCatch m, HasCallStack) ⇒ String → m a","name":"readNoteM","module":"Hedgehog.Extras.Stock.String","link":"Hedgehog-Extras-Stock-String.html#v:readNoteM"},{"display_html":"module Hedgehog.Extras.Stock.Time","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.String","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.OS","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.Monad","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.IO.Process","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.IO.Network.Sprocket","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.IO.Network.Socket","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.IO.Network.NamedPipe","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.IO.File","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.CallStack","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"module Hedgehog.Extras.Stock.Aeson","name":"","module":"Hedgehog.Extras.Stock","link":""},{"display_html":"doesFileExists ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m Bool","name":"doesFileExists","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:doesFileExists"},{"display_html":"isPortOpen ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ Int → m Bool","name":"isPortOpen","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:isPortOpen"},{"display_html":"doesSocketExist ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m Bool","name":"doesSocketExist","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:doesSocketExist"},{"display_html":"assertPortOpen ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ Int → m ()","name":"assertPortOpen","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:assertPortOpen"},{"display_html":"assertSocketExists ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePath → m ()","name":"assertSocketExists","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:assertSocketExists"},{"display_html":"doesSprocketExist ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ Sprocket → m Bool","name":"doesSprocketExist","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:doesSprocketExist"},{"display_html":"downloadToFile ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ StringFilePath → m ()","name":"downloadToFile","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:downloadToFile"},{"display_html":"downloadAndExtractGithubCommitToTemp ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ FilePathStringString → m FilePath","name":"downloadAndExtractGithubCommitToTemp","module":"Hedgehog.Extras.Test.Network","link":"Hedgehog-Extras-Test-Network.html#v:downloadAndExtractGithubCommitToTemp"},{"display_html":"createProcess ∷ (MonadTest m, MonadResource m, HasCallStack) ⇒ CreateProcess → m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle, ReleaseKey)","name":"createProcess","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:createProcess"},{"display_html":"exec ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ExecConfigString → [String] → m String","name":"exec","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:exec"},{"display_html":"execAny ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ExecConfigString → [String] → m (ExitCode, String, String)","name":"execAny","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:execAny"},{"display_html":"exec_ ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ExecConfigString → [String] → m ()","name":"exec_","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:exec_"},{"display_html":"execFlex ∷ (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) ⇒ StringString → [String] → m String","name":"execFlex","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:execFlex"},{"display_html":"execFlex' ∷ (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) ⇒ ExecConfigStringString → [String] → m String","name":"execFlex'","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:execFlex-39-"},{"display_html":"execFlexAny' ∷ (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) ⇒ ExecConfigStringString → [String] → m (ExitCode, String, String)","name":"execFlexAny'","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:execFlexAny-39-"},{"display_html":"procFlex ∷ (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) ⇒ StringString → [String] → m CreateProcess","name":"procFlex","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:procFlex"},{"display_html":"binFlex ∷ (HasCallStack, MonadTest m, MonadIO m) ⇒ StringString → m FilePath","name":"binFlex","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:binFlex"},{"display_html":"getProjectBase ∷ (MonadTest m, MonadIO m) ⇒ m String","name":"getProjectBase","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:getProjectBase"},{"display_html":"waitForProcess ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m ExitCode","name":"waitForProcess","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:waitForProcess"},{"display_html":"maybeWaitForProcess ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m (Maybe ExitCode)","name":"maybeWaitForProcess","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:maybeWaitForProcess"},{"display_html":"getPid ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m (Maybe Pid)","name":"getPid","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:getPid"},{"display_html":"getPidOk ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ ProcessHandle → m Pid","name":"getPidOk","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:getPidOk"},{"display_html":"waitSecondsForProcess ∷ (MonadTest m, MonadIO m, HasCallStack) ⇒ Int → ProcessHandle → m (Either TimedOut ExitCode)","name":"waitSecondsForProcess","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:waitSecondsForProcess"},{"display_html":"data ExecConfig = ExecConfig {}","name":"ExecConfig ExecConfig execConfigEnv execConfigCwd","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#t:ExecConfig"},{"display_html":"defaultExecConfigExecConfig","name":"defaultExecConfig","module":"Hedgehog.Extras.Test.Process","link":"Hedgehog-Extras-Test-Process.html#v:defaultExecConfig"},{"display_html":"runWithWatchdog_HasCallStack ⇒ MonadBaseControl IO m ⇒ WatchdogConfig → (HasCallStack ⇒ m a) → m a","name":"runWithWatchdog_","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:runWithWatchdog_"},{"display_html":"runWithWatchdogHasCallStack ⇒ MonadBaseControl IO m ⇒ WatchdogConfig → (HasCallStackWatchdog → m a) → m a","name":"runWithWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:runWithWatchdog"},{"display_html":"runWithDefaultWatchdog_HasCallStack ⇒ MonadBaseControl IO m ⇒ (HasCallStack ⇒ m a) → m a","name":"runWithDefaultWatchdog_","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:runWithDefaultWatchdog_"},{"display_html":"runWithDefaultWatchdogHasCallStack ⇒ MonadBaseControl IO m ⇒ (HasCallStackWatchdog → m a) → m a","name":"runWithDefaultWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:runWithDefaultWatchdog"},{"display_html":"kickWatchdogMonadIO m ⇒ Watchdog → m ()","name":"kickWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:kickWatchdog"},{"display_html":"poisonWatchdogMonadIO m ⇒ Watchdog → m ()","name":"poisonWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:poisonWatchdog"},{"display_html":"data Watchdog","name":"Watchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#t:Watchdog"},{"display_html":"newtype WatchdogConfig = WatchdogConfig {}","name":"WatchdogConfig WatchdogConfig watchdogTimeout","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#t:WatchdogConfig"},{"display_html":"newtype WatchdogException = WatchdogException {}","name":"WatchdogException WatchdogException timeElapsed","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#t:WatchdogException"},{"display_html":"makeWatchdog ∷ MonadBase IO m ⇒ WatchdogConfigThreadId → m Watchdog","name":"makeWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:makeWatchdog"},{"display_html":"runWatchdog ∷ MonadBase IO m ⇒ Watchdog → m ()","name":"runWatchdog","module":"Hedgehog.Extras.Test.TestWatchdog","link":"Hedgehog-Extras-Test-TestWatchdog.html#v:runWatchdog"},{"display_html":"data Tripwire","name":"Tripwire","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#t:Tripwire"},{"display_html":"makeTripwireMonadIO m ⇒ m Tripwire","name":"makeTripwire","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:makeTripwire"},{"display_html":"makeTripwireWithLabelMonadIO m ⇒ String → m Tripwire","name":"makeTripwireWithLabel","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:makeTripwireWithLabel"},{"display_html":"tripHasCallStackMonadIO m ⇒ MonadTest m ⇒ Tripwire → m ()","name":"trip","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:trip"},{"display_html":"trip_HasCallStackMonadIO m ⇒ Tripwire → m ()","name":"trip_","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:trip_"},{"display_html":"isTrippedMonadIO m ⇒ Tripwire → m Bool","name":"isTripped","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:isTripped"},{"display_html":"getTripSiteMonadIO m ⇒ Tripwire → m (Maybe CallStack)","name":"getTripSite","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:getTripSite"},{"display_html":"resetTripwireMonadIO m ⇒ Tripwire → m ()","name":"resetTripwire","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:resetTripwire"},{"display_html":"assertNotTrippedHasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ Tripwire → m ()","name":"assertNotTripped","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:assertNotTripped"},{"display_html":"assertTrippedHasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ Tripwire → m ()","name":"assertTripped","module":"Hedgehog.Extras.Test.Tripwire","link":"Hedgehog-Extras-Test-Tripwire.html#v:assertTripped"},{"display_html":"module Hedgehog.Extras.Test.Tripwire","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.TestWatchdog","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.Process","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.Network","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.MonadAssertion","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.File","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.Concurrent","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"module Hedgehog.Extras.Test.Base","name":"","module":"Hedgehog.Extras.Test","link":""},{"display_html":"diffVsGoldenFileHasCallStack ⇒ (MonadIO m, MonadTest m) ⇒ StringFilePath → m ()","name":"diffVsGoldenFile","module":"Hedgehog.Extras.Test.Golden","link":"Hedgehog-Extras-Test-Golden.html#v:diffVsGoldenFile"},{"display_html":"diffFileVsGoldenFileHasCallStack ⇒ (MonadIO m, MonadTest m) ⇒ FilePathFilePath → m ()","name":"diffFileVsGoldenFile","module":"Hedgehog.Extras.Test.Golden","link":"Hedgehog-Extras-Test-Golden.html#v:diffFileVsGoldenFile"},{"display_html":"module Hedgehog.Extras.Test","name":"","module":"Hedgehog.Extras","link":""}] \ No newline at end of file diff --git a/hedgehog-extras/hedgehog-extras.haddock b/hedgehog-extras/hedgehog-extras.haddock index f45f77ec..1064a69d 100644 Binary files a/hedgehog-extras/hedgehog-extras.haddock and b/hedgehog-extras/hedgehog-extras.haddock differ diff --git a/hedgehog-extras/src/Hedgehog.Extras.Aeson.html b/hedgehog-extras/src/Hedgehog.Extras.Aeson.html index 9e62ba75..06106974 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Aeson.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Aeson.html @@ -41,21 +41,21 @@ strictComparison = Bool False -goldenTestJsonValue :: forall a. () - => Eq a - => FromJSON a - => Show a - => ToJSON a +goldenTestJsonValue :: forall a. () + => Eq a + => FromJSON a + => Show a + => ToJSON a => HasCallStack - => a + => a -> FilePath -> Property goldenTestJsonValue :: forall a. (Eq a, FromJSON a, Show a, ToJSON a, HasCallStack) => a -> FilePath -> Property -goldenTestJsonValue a -x FilePath -path = forall a. HasCallStack => (HasCallStack => a) -> a +goldenTestJsonValue a +x FilePath +path = forall a. HasCallStack => (HasCallStack => a) -> a withFrozenCallStack forall a b. (a -> b) -> a -> b $ TestLimit -> Property -> Property withTests TestLimit @@ -63,11 +63,11 @@ . HasCallStack => PropertyT IO () -> Property property forall a b. (a -> b) -> a -> b $ do - ByteString -bs <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + ByteString +bs <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (FilePath -> IO ByteString LBS.readFile FilePath -path) +path) forall (f :: * -> *). Applicative f => Bool -> f () -> f () when Bool writeNewGoldFiles forall a b. (a -> b) -> a -> b @@ -75,30 +75,30 @@ liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c . FilePath -> ByteString -> IO () LBS.writeFile (FilePath -path forall a. Semigroup a => a -> a -> a +path forall a. Semigroup a => a -> a -> a <> FilePath ".gold") forall a b. (a -> b) -> a -> b $ forall a. ToJSON a => a -> ByteString encode a -x +x forall (f :: * -> *). Applicative f => Bool -> f () -> f () when Bool strictComparison forall a b. (a -> b) -> a -> b $ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap forall a. ToJSON a => a -> ByteString encode (forall a. FromJSON a => ByteString -> Either FilePath a -eitherDecode @a ByteString -bs) forall (m :: * -> *) a. +eitherDecode @a ByteString +bs) forall (m :: * -> *) a. (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m () === forall a b. b -> Either a b Right ByteString -bs +bs case forall a. FromJSON a => ByteString -> Either FilePath a eitherDecode ByteString -bs of - Left FilePath -err -> forall (m :: * -> *) a. +bs of + Left FilePath +err -> forall (m :: * -> *) a. (MonadTest m, HasCallStack) => Maybe Diff -> FilePath -> m a H.failWith forall a. Maybe a @@ -107,31 +107,31 @@ "could not decode: " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> FilePath show FilePath -err - Right a -x' -> a -x forall (m :: * -> *) a. +err + Right a +x' -> a +x forall (m :: * -> *) a. (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m () === a -x' +x' goldenTestJsonValuePretty - :: forall a. () - => Eq a - => FromJSON a + :: forall a. () + => Eq a + => FromJSON a => HasCallStack - => Show a - => ToJSON a - => a + => Show a + => ToJSON a + => a -> FilePath -> Property goldenTestJsonValuePretty :: forall a. (Eq a, FromJSON a, HasCallStack, Show a, ToJSON a) => a -> FilePath -> Property -goldenTestJsonValuePretty a -x FilePath -path = +goldenTestJsonValuePretty a +x FilePath +path = forall a. HasCallStack => (HasCallStack => a) -> a withFrozenCallStack forall a b. (a -> b) -> a -> b @@ -143,17 +143,17 @@ property forall a b. (a -> b) -> a -> b $ do - ByteString -bs <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + ByteString +bs <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (FilePath -> IO ByteString LBS.readFile FilePath -path) +path) -- Sort keys by their order of appearance in the argument list -- of `keyOrder`. Keys not in the argument list are moved to the -- end, while their order is preserved. let - defConfig' :: Config -defConfig' = Config + defConfig' :: Config +defConfig' = Config { confIndent :: Indent confIndent = Int -> Indent Spaces Int @@ -177,32 +177,32 @@ liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c . FilePath -> ByteString -> IO () LBS.writeFile (FilePath -path forall a. Semigroup a => a -> a -> a +path forall a. Semigroup a => a -> a -> a <> FilePath ".gold") forall a b. (a -> b) -> a -> b $ forall a. ToJSON a => Config -> a -> ByteString encodePretty' Config -defConfig' a -x +defConfig' a +x forall (f :: * -> *). Applicative f => Bool -> f () -> f () when Bool strictComparison forall a b. (a -> b) -> a -> b $ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap (forall a. ToJSON a => Config -> a -> ByteString encodePretty' Config -defConfig') (forall a. FromJSON a => ByteString -> Either FilePath a -eitherDecode @a ByteString -bs) forall (m :: * -> *) a. +defConfig') (forall a. FromJSON a => ByteString -> Either FilePath a +eitherDecode @a ByteString +bs) forall (m :: * -> *) a. (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m () === forall a b. b -> Either a b Right ByteString -bs +bs case forall a. FromJSON a => ByteString -> Either FilePath a eitherDecode ByteString -bs of - Left FilePath -err -> forall (m :: * -> *) a. +bs of + Left FilePath +err -> forall (m :: * -> *) a. (MonadTest m, HasCallStack) => Maybe Diff -> FilePath -> m a H.failWith forall a. Maybe a @@ -211,12 +211,12 @@ "could not decode: " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> FilePath show FilePath -err - Right a -x' -> a -x forall (m :: * -> *) a. +err + Right a +x' -> a +x forall (m :: * -> *) a. (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m () === a -x' +x' \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Internal.Cli.html b/hedgehog-extras/src/Hedgehog.Extras.Internal.Cli.html index 3dbf4b51..11c9a72a 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Internal.Cli.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Internal.Cli.html @@ -15,92 +15,92 @@ -- Note, this function does not cover all the edge cases for shell processing, so avoid use in production code. argQuote :: String -> String argQuote :: String -> String -argQuote String -arg = if Char +argQuote String +arg = if Char ' ' forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool `L.elem` String -arg Bool -> Bool -> Bool +arg Bool -> Bool -> Bool || Char '"' forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool `L.elem` String -arg Bool -> Bool -> Bool +arg Bool -> Bool -> Bool || Char '$' forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool `L.elem` String -arg +arg then String "\"" forall a. Semigroup a => a -> a -> a <> String -> String -escape String -arg forall a. Semigroup a => a -> a -> a +escape String +arg forall a. Semigroup a => a -> a -> a <> String "\"" else String -arg - where escape :: String -> String - escape :: String -> String -escape (Char -'"':String -xs) = Char +arg + where escape :: String -> String + escape :: String -> String +escape (Char +'"':String +xs) = Char '\\'forall a. a -> [a] -> [a] :Char '"'forall a. a -> [a] -> [a] :String -> String -escape String -xs - escape (Char -'\\':String -xs) = Char +escape String +xs + escape (Char +'\\':String +xs) = Char '\\'forall a. a -> [a] -> [a] :Char '\\'forall a. a -> [a] -> [a] :String -> String -escape String -xs - escape (Char -'\n':String -xs) = Char +escape String +xs + escape (Char +'\n':String +xs) = Char '\\'forall a. a -> [a] -> [a] :Char 'n'forall a. a -> [a] -> [a] :String -> String -escape String -xs - escape (Char -'\r':String -xs) = Char +escape String +xs + escape (Char +'\r':String +xs) = Char '\\'forall a. a -> [a] -> [a] :Char 'r'forall a. a -> [a] -> [a] :String -> String -escape String -xs - escape (Char -'\t':String -xs) = Char +escape String +xs + escape (Char +'\t':String +xs) = Char '\\'forall a. a -> [a] -> [a] :Char 't'forall a. a -> [a] -> [a] :String -> String -escape String -xs - escape (Char -'$':String -xs) = Char +escape String +xs + escape (Char +'$':String +xs) = Char '\\'forall a. a -> [a] -> [a] :Char '$'forall a. a -> [a] -> [a] :String -> String -escape String -xs - escape (Char -x:String -xs) = Char -xforall a. a -> [a] -> [a] +escape String +xs + escape (Char +x:String +xs) = Char +xforall a. a -> [a] -> [a] :String -> String -escape String -xs - escape String +escape String +xs + escape String "" = String "" \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Internal.Plan.html b/hedgehog-extras/src/Hedgehog.Extras.Internal.Plan.html index a693ee27..d94961a4 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Internal.Plan.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Internal.Plan.html @@ -15,7 +15,7 @@ import GHC.Generics import Text.Show -data Component = Component +data Component = Component { Component -> Maybe Text componentName :: Maybe Text , Component -> Maybe Text @@ -27,13 +27,13 @@ (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep Component x -> Component $cfrom :: forall x. Component -> Rep Component x -Generic, Component -> Component -> Bool +Generic, Component -> Component -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: Component -> Component -> Bool $c/= :: Component -> Component -> Bool == :: Component -> Component -> Bool $c== :: Component -> Component -> Bool -Eq, Int -> Component -> ShowS +Eq, Int -> Component -> ShowS [Component] -> ShowS Component -> String forall a. @@ -46,7 +46,7 @@ $cshowsPrec :: Int -> Component -> ShowS Show) -newtype Plan = Plan +newtype Plan = Plan { Plan -> [Component] installPlan :: [Component] } @@ -56,13 +56,13 @@ (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep Plan x -> Plan $cfrom :: forall x. Plan -> Rep Plan x -Generic, Plan -> Plan -> Bool +Generic, Plan -> Plan -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: Plan -> Plan -> Bool $c/= :: Plan -> Plan -> Bool == :: Plan -> Plan -> Bool $c== :: Plan -> Plan -> Bool -Eq, Int -> Plan -> ShowS +Eq, Int -> Plan -> ShowS [Plan] -> ShowS Plan -> String forall a. @@ -75,36 +75,36 @@ $cshowsPrec :: Int -> Plan -> ShowS Show) -instance FromJSON Plan where - parseJSON :: Value -> Parser Plan +instance FromJSON Plan where + parseJSON :: Value -> Parser Plan parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a withObject String "Plan" forall a b. (a -> b) -> a -> b -$ \Object -v -> [Component] -> Plan +$ \Object +v -> [Component] -> Plan Plan forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Object -v forall a. FromJSON a => Object -> Key -> Parser a +v forall a. FromJSON a => Object -> Key -> Parser a .: Key "install-plan" -instance FromJSON Component where - parseJSON :: Value -> Parser Component -parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a +instance FromJSON Component where + parseJSON :: Value -> Parser Component +parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a withObject String "Plan" forall a b. (a -> b) -> a -> b -$ \Object -v -> Maybe Text -> Maybe Text -> Component +$ \Object +v -> Maybe Text -> Maybe Text -> Component Component forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Object -v forall a. FromJSON a => Object -> Key -> Parser (Maybe a) +v forall a. FromJSON a => Object -> Key -> Parser (Maybe a) .:? Key "component-name" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object -v forall a. FromJSON a => Object -> Key -> Parser (Maybe a) +v forall a. FromJSON a => Object -> Key -> Parser (Maybe a) .:? Key "bin-file" \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Internal.Test.Integration.html b/hedgehog-extras/src/Hedgehog.Extras.Internal.Test.Integration.html index 432b34dd..71c47b19 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Internal.Test.Integration.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Internal.Test.Integration.html @@ -18,7 +18,7 @@ import qualified Control.Concurrent.STM as STM import qualified Hedgehog as H -newtype IntegrationState = IntegrationState +newtype IntegrationState = IntegrationState { IntegrationState -> TVar [Integration ()] integrationStateFinals :: STM.TVar [Integration ()] } deriving (forall x. Rep IntegrationState x -> IntegrationState @@ -29,7 +29,7 @@ $cfrom :: forall x. IntegrationState -> Rep IntegrationState x Generic) -type Integration a = H.PropertyT (ReaderT IntegrationState (ResourceT IO)) a +type Integration a = H.PropertyT (ReaderT IntegrationState (ResourceT IO)) a newIntegrationStateIO :: IO IntegrationState newIntegrationStateIO :: IO IntegrationState @@ -38,23 +38,23 @@ <$> forall a. a -> IO (TVar a) STM.newTVarIO [] -newIntegrationStateM :: MonadIO m => m IntegrationState +newIntegrationStateM :: MonadIO m => m IntegrationState newIntegrationStateM :: forall (m :: * -> *). MonadIO m => m IntegrationState newIntegrationStateM = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO IntegrationState newIntegrationStateIO -runIntegrationReaderT :: MonadIO m => ReaderT IntegrationState m a -> m a +runIntegrationReaderT :: MonadIO m => ReaderT IntegrationState m a -> m a runIntegrationReaderT :: forall (m :: * -> *) a. MonadIO m => ReaderT IntegrationState m a -> m a -runIntegrationReaderT ReaderT IntegrationState m a -f = do - IntegrationState -s <- forall (m :: * -> *). MonadIO m => m IntegrationState +runIntegrationReaderT ReaderT IntegrationState m a +f = do + IntegrationState +s <- forall (m :: * -> *). MonadIO m => m IntegrationState newIntegrationStateM forall r (m :: * -> *) a. ReaderT r m a -> r -> m a runReaderT ReaderT IntegrationState m a -f IntegrationState -s +f IntegrationState +s \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Stock.Aeson.html b/hedgehog-extras/src/Hedgehog.Extras.Stock.Aeson.html index 6fa7a5d2..9dfb30fe 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Stock.Aeson.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Stock.Aeson.html @@ -12,31 +12,31 @@ -- All other JSON values are preserved. rewriteObject :: (KeyMap Value -> KeyMap Value) -> Value -> Value rewriteObject :: (KeyMap Value -> KeyMap Value) -> Value -> Value -rewriteObject KeyMap Value -> KeyMap Value -f (Object KeyMap Value -hm) = KeyMap Value -> Value +rewriteObject KeyMap Value -> KeyMap Value +f (Object KeyMap Value +hm) = KeyMap Value -> Value Object (KeyMap Value -> KeyMap Value -f KeyMap Value -hm) +f KeyMap Value +hm) rewriteObject KeyMap Value -> KeyMap Value -_ Value -v = Value -v +_ Value +v = Value +v -- | Rewrite each element of a JSON array using the function 'f'. -- -- All other JSON values are preserved. rewriteArrayElements :: (Value -> Value) -> Value -> Value rewriteArrayElements :: (Value -> Value) -> Value -> Value -rewriteArrayElements Value -> Value -f (Array Array -hm) = Array -> Value +rewriteArrayElements Value -> Value +f (Array Array +hm) = Array -> Value Array (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap Value -> Value -f Array -hm) +f Array +hm) rewriteArrayElements Value -> Value -_ Value -v = Value -v +_ Value +v = Value +v \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.File.html b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.File.html index 05aa5ece..26d53fee 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.File.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.File.html @@ -13,12 +13,12 @@ -- | Determine if the given string is found in the given file. fileContains :: String -> FilePath -> IO Bool fileContains :: String -> String -> IO Bool -fileContains String -text String -path = (String -text forall a. Eq a => [a] -> [a] -> Bool +fileContains String +text String +path = (String +text forall a. Eq a => [a] -> [a] -> Bool `L.isInfixOf`) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> String -> IO String IO.readFile String -path +path \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.NamedPipe.html b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.NamedPipe.html index e87f458b..de2cd8ef 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.NamedPipe.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.NamedPipe.html @@ -17,8 +17,8 @@ doesNamedPipeExist :: FilePath -> IO Bool doesNamedPipeExist :: FilePath -> IO Bool -doesNamedPipeExist FilePath -path = +doesNamedPipeExist FilePath +path = #ifdef mingw32_HOST_OS W32.waitNamedPipe path 1 #else diff --git a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Port.html b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Port.html index b09e839c..3e50bba1 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Port.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Port.html @@ -16,18 +16,18 @@ import Network.Socket -- | Return a random available port on a specified host address -randomPort :: () - => MonadIO m - => MonadFail m +randomPort :: () + => MonadIO m + => MonadFail m => HostAddress - -> m PortNumber + -> m PortNumber randomPort :: forall (m :: * -> *). (MonadIO m, MonadFail m) => HostAddress -> m PortNumber -randomPort HostAddress -hostAddress = do - Socket -sock <- forall (m :: * -> *) a. MonadIO m => IO a -> m a +randomPort HostAddress +hostAddress = do + Socket +sock <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Family -> SocketType -> ProtocolNumber -> IO Socket socket Family @@ -39,46 +39,46 @@ liftIO forall a b. (a -> b) -> a -> b $ Socket -> SocketOption -> Int -> IO () setSocketOption Socket -sock SocketOption +sock SocketOption ReuseAddr Int 1 forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Socket -> SockAddr -> IO () bind Socket -sock forall a b. (a -> b) -> a -> b +sock forall a b. (a -> b) -> a -> b $ PortNumber -> HostAddress -> SockAddr SockAddrInet PortNumber defaultPort HostAddress -hostAddress - SockAddrInet PortNumber -port HostAddress +hostAddress + SockAddrInet PortNumber +port HostAddress _ <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Socket -> IO SockAddr getSocketName Socket -sock +sock forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Socket -> IO () close Socket -sock +sock forall (m :: * -> *) a. Monad m => a -> m a return PortNumber -port +port -reserveRandomPort :: () - => MonadFail m - => MonadResource m +reserveRandomPort :: () + => MonadFail m + => MonadResource m => HostAddress - -> m (ReleaseKey, PortNumber) + -> m (ReleaseKey, PortNumber) reserveRandomPort :: forall (m :: * -> *). (MonadFail m, MonadResource m) => HostAddress -> m (ReleaseKey, PortNumber) -reserveRandomPort HostAddress -hostAddress = do - Socket -sock <- forall (m :: * -> *) a. MonadIO m => IO a -> m a +reserveRandomPort HostAddress +hostAddress = do + Socket +sock <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Family -> SocketType -> ProtocolNumber -> IO Socket socket Family @@ -89,50 +89,50 @@ liftIO forall a b. (a -> b) -> a -> b $ Socket -> SocketOption -> Int -> IO () setSocketOption Socket -sock SocketOption +sock SocketOption ReuseAddr Int 1 forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Socket -> SockAddr -> IO () bind Socket -sock forall a b. (a -> b) -> a -> b +sock forall a b. (a -> b) -> a -> b $ PortNumber -> HostAddress -> SockAddr SockAddrInet PortNumber defaultPort HostAddress -hostAddress - SockAddrInet PortNumber -port HostAddress +hostAddress + SockAddrInet PortNumber +port HostAddress _ <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Socket -> IO SockAddr getSocketName Socket -sock - ReleaseKey -releaseKey <- forall (m :: * -> *). MonadResource m => IO () -> m ReleaseKey +sock + ReleaseKey +releaseKey <- forall (m :: * -> *). MonadResource m => IO () -> m ReleaseKey register forall a b. (a -> b) -> a -> b $ Socket -> IO () close Socket -sock +sock forall (m :: * -> *) a. Monad m => a -> m a return (ReleaseKey -releaseKey, PortNumber -port) +releaseKey, PortNumber +port) -- | Check if a port is in use on a specified host address -portInUse :: () - => MonadIO m +portInUse :: () + => MonadIO m => HostAddress -> PortNumber - -> m Bool + -> m Bool portInUse :: forall (m :: * -> *). MonadIO m => HostAddress -> PortNumber -> m Bool -portInUse HostAddress -hostAddress PortNumber -pn = do - Socket -sock <- forall (m :: * -> *) a. MonadIO m => IO a -> m a +portInUse HostAddress +hostAddress PortNumber +pn = do + Socket +sock <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Family -> SocketType -> ProtocolNumber -> IO Socket socket Family @@ -143,25 +143,25 @@ liftIO forall a b. (a -> b) -> a -> b $ Socket -> SocketOption -> Int -> IO () setSocketOption Socket -sock SocketOption +sock SocketOption ReuseAddr Int 1 - Either SomeException () -result <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + Either SomeException () +result <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ forall e a. Exception e => IO a -> IO (Either e a) try @SomeException forall a b. (a -> b) -> a -> b $ Socket -> SockAddr -> IO () bind Socket -sock (PortNumber -> HostAddress -> SockAddr +sock (PortNumber -> HostAddress -> SockAddr SockAddrInet PortNumber -pn HostAddress -hostAddress) +pn HostAddress +hostAddress) forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Socket -> IO () close Socket -sock +sock forall (m :: * -> *) a. Monad m => a -> m a return forall a b. (a -> b) -> a -> b $ forall a c b. (a -> c) -> (b -> c) -> Either a b -> c @@ -170,5 +170,5 @@ False) (forall a b. a -> b -> a const Bool True) Either SomeException () -result +result \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Socket.html b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Socket.html index c187f29f..32ded678 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Socket.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Socket.html @@ -28,10 +28,10 @@ -- | Check if a TCP port is open isPortOpen :: Int -> IO Bool isPortOpen :: Int -> IO Bool -isPortOpen Int -port = do - [AddrInfo] -socketAddressInfos <- forall (t :: * -> *). +isPortOpen Int +port = do + [AddrInfo] +socketAddressInfos <- forall (t :: * -> *). GetAddrInfo t => Maybe AddrInfo -> Maybe HostName -> Maybe HostName -> IO (t AddrInfo) @@ -41,11 +41,11 @@ "127.0.0.1") (forall a. a -> Maybe a Just (forall a. Show a => a -> HostName show Int -port)) +port)) case [AddrInfo] -socketAddressInfos of - AddrInfo -socketAddressInfo:[AddrInfo] +socketAddressInfos of + AddrInfo +socketAddressInfo:[AddrInfo] _ -> forall e a. Exception e => (e -> IO a) -> IO a -> IO a handle (forall (m :: * -> *) a. Monad m => a -> m a @@ -57,7 +57,7 @@ SockAddr -> IO () canConnect (AddrInfo -> SockAddr IO.addrAddress AddrInfo -socketAddressInfo) forall (f :: * -> *) a b. Functor f => f a -> b -> f b +socketAddressInfo) forall (f :: * -> *) a b. Functor f => f a -> b -> f b $> Bool True [] -> forall (m :: * -> *) a. Monad m => a -> m a @@ -67,8 +67,8 @@ -- | Check if it is possible to connect to a socket address canConnect :: SockAddr -> IO () canConnect :: SockAddr -> IO () -canConnect SockAddr -sockAddr = forall (m :: * -> *) a b c. +canConnect SockAddr +sockAddr = forall (m :: * -> *) a b c. MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c IO.bracket (Family -> SocketType -> ProtocolNumber -> IO Socket @@ -77,26 +77,26 @@ Stream ProtocolNumber 6) Socket -> IO () IO.close' forall a b. (a -> b) -> a -> b -$ \Socket -sock -> do +$ \Socket +sock -> do Socket -> SockAddr -> IO () IO.connect Socket -sock SockAddr -sockAddr +sock SockAddr +sockAddr -- | Open a socket at the specified port for listening listenOn :: Int -> IO Socket listenOn :: Int -> IO Socket -listenOn Int -n = do - Socket -sock <- Family -> SocketType -> ProtocolNumber -> IO Socket +listenOn Int +n = do + Socket +sock <- Family -> SocketType -> ProtocolNumber -> IO Socket IO.socket Family AF_INET SocketType Stream ProtocolNumber 0 - AddrInfo -sockAddrInfo:[AddrInfo] + AddrInfo +sockAddrInfo:[AddrInfo] _ <- forall (t :: * -> *). GetAddrInfo t => Maybe AddrInfo @@ -107,24 +107,24 @@ "127.0.0.1") (forall a. a -> Maybe a Just (forall a. Show a => a -> HostName show Int -n)) +n)) Socket -> SocketOption -> Int -> IO () IO.setSocketOption Socket -sock SocketOption +sock SocketOption IO.ReuseAddr Int 1 Socket -> SockAddr -> IO () IO.bind Socket -sock (AddrInfo -> SockAddr +sock (AddrInfo -> SockAddr IO.addrAddress AddrInfo -sockAddrInfo) +sockAddrInfo) Socket -> Int -> IO () IO.listen Socket -sock Int +sock Int 2 forall (m :: * -> *) a. Monad m => a -> m a return Socket -sock +sock doesSocketExist :: FilePath -> IO Bool doesSocketExist :: HostName -> IO Bool @@ -135,10 +135,10 @@ -- | Allocate the specified number of random ports allocateRandomPorts :: Int -> IO [Int] allocateRandomPorts :: Int -> IO [Int] -allocateRandomPorts Int -n = do - let hints :: AddrInfo -hints = AddrInfo +allocateRandomPorts Int +n = do + let hints :: AddrInfo +hints = AddrInfo IO.defaultHints { addrFlags :: [AddrInfoFlag] IO.addrFlags = [AddrInfoFlag @@ -149,58 +149,58 @@ } -- Create n sockets with randomly bound ports, grab the port numbers and close those ports - AddrInfo -addr:[AddrInfo] + AddrInfo +addr:[AddrInfo] _ <- forall (t :: * -> *). GetAddrInfo t => Maybe AddrInfo -> Maybe HostName -> Maybe HostName -> IO (t AddrInfo) IO.getAddrInfo (forall a. a -> Maybe a Just AddrInfo -hints) (forall a. a -> Maybe a +hints) (forall a. a -> Maybe a Just HostName "127.0.0.1") (forall a. a -> Maybe a Just HostName "0") - [Socket] -socks <- forall (t :: * -> *) (m :: * -> *) a b. + [Socket] +socks <- forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b) forM [Int 1..Int -n] forall a b. (a -> b) -> a -> b +n] forall a b. (a -> b) -> a -> b $ \Int _ -> Family -> SocketType -> ProtocolNumber -> IO Socket IO.socket (AddrInfo -> Family IO.addrFamily AddrInfo -addr) (AddrInfo -> SocketType +addr) (AddrInfo -> SocketType IO.addrSocketType AddrInfo -addr) (AddrInfo -> ProtocolNumber +addr) (AddrInfo -> ProtocolNumber IO.addrProtocol AddrInfo -addr) +addr) forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => t a -> (a -> m b) -> m () forM_ [Socket] -socks forall a b. (a -> b) -> a -> b -$ \Socket -sock -> Socket -> SockAddr -> IO () +socks forall a b. (a -> b) -> a -> b +$ \Socket +sock -> Socket -> SockAddr -> IO () IO.bind Socket -sock (AddrInfo -> SockAddr +sock (AddrInfo -> SockAddr IO.addrAddress AddrInfo -addr) - [PortNumber] -ports <- forall (t :: * -> *) (m :: * -> *) a b. +addr) + [PortNumber] +ports <- forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b) forM [Socket] -socks Socket -> IO PortNumber +socks Socket -> IO PortNumber IO.socketPort forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => t a -> (a -> m b) -> m () forM_ [Socket] -socks Socket -> IO () +socks Socket -> IO () IO.close forall (m :: * -> *) a. Monad m => a -> m a @@ -208,5 +208,5 @@ $ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap forall a b. (Integral a, Num b) => a -> b fromIntegral [PortNumber] -ports +ports \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Sprocket.html b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Sprocket.html index c73d036b..bf7c585a 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Sprocket.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Network.Sprocket.html @@ -25,7 +25,7 @@ import qualified Hedgehog.Extras.Stock.IO.Network.Socket as IO -- | Socket emulation. On Posix it represents a socket. On Windows it represents a named pipe. -data Sprocket = Sprocket +data Sprocket = Sprocket { Sprocket -> FilePath sprocketBase :: String , Sprocket -> FilePath @@ -36,13 +36,13 @@ (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep Sprocket x -> Sprocket $cfrom :: forall x. Sprocket -> Rep Sprocket x -Generic, Sprocket -> Sprocket -> Bool +Generic, Sprocket -> Sprocket -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: Sprocket -> Sprocket -> Bool $c/= :: Sprocket -> Sprocket -> Bool == :: Sprocket -> Sprocket -> Bool $c== :: Sprocket -> Sprocket -> Bool -Eq, Int -> Sprocket -> ShowS +Eq, Int -> Sprocket -> ShowS [Sprocket] -> ShowS Sprocket -> FilePath forall a. @@ -58,47 +58,47 @@ -- | Test if the sprocket exists doesSprocketExist :: Sprocket -> IO Bool doesSprocketExist :: Sprocket -> IO Bool -doesSprocketExist Sprocket -socket = if Bool +doesSprocketExist Sprocket +socket = if Bool isWin32 then FilePath -> IO Bool IO.doesNamedPipeExist (Sprocket -> FilePath sprocketSystemName Sprocket -socket) +socket) else FilePath -> IO Bool IO.doesSocketExist (Sprocket -> FilePath sprocketSystemName Sprocket -socket) +socket) -- | Use this to query the OS about the sprocket sprocketSystemName :: Sprocket -> FilePath sprocketSystemName :: Sprocket -> FilePath -sprocketSystemName sprocket :: Sprocket -sprocket@(Sprocket FilePath -base FilePath -name) = if Bool +sprocketSystemName sprocket :: Sprocket +sprocket@(Sprocket FilePath +base FilePath +name) = if Bool isWin32 then Sprocket -> FilePath sprocketNamedPipeName Sprocket -sprocket +sprocket else FilePath -base FilePath -> ShowS +base FilePath -> ShowS </> FilePath -name +name -- | Use this when needing to pass a sprocket into a command line argument. sprocketArgumentName :: Sprocket -> FilePath sprocketArgumentName :: Sprocket -> FilePath -sprocketArgumentName sprocket :: Sprocket -sprocket@(Sprocket FilePath -_ FilePath -name) = if Bool +sprocketArgumentName sprocket :: Sprocket +sprocket@(Sprocket FilePath +_ FilePath +name) = if Bool isWin32 then Sprocket -> FilePath sprocketNamedPipeName Sprocket -sprocket +sprocket else FilePath -name +name maxSprocketArgumentNameLength :: Int maxSprocketArgumentNameLength :: Int @@ -113,41 +113,41 @@ sprocketNamedPipeName :: Sprocket -> FilePath sprocketNamedPipeName :: Sprocket -> FilePath sprocketNamedPipeName (Sprocket FilePath -_ FilePath -name) = FilePath +_ FilePath +name) = FilePath "\\\\.\\pipe" forall a. Semigroup a => a -> a -> a <> ShowS -dedupBackslash (FilePath +dedupBackslash (FilePath "\\" forall a. Semigroup a => a -> a -> a <> forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap Char -> Char -slackToBack FilePath -name) - where slackToBack :: Char -> Char - slackToBack :: Char -> Char -slackToBack Char -c = if Char -c forall a. Eq a => a -> a -> Bool +slackToBack FilePath +name) + where slackToBack :: Char -> Char + slackToBack :: Char -> Char +slackToBack Char +c = if Char +c forall a. Eq a => a -> a -> Bool == Char '/' then Char '\\' else Char -c - dedupBackslash :: String -> String - dedupBackslash :: ShowS -dedupBackslash (Char +c + dedupBackslash :: String -> String + dedupBackslash :: ShowS +dedupBackslash (Char '\\':Char -'\\':FilePath -xs) = ShowS -dedupBackslash (Char +'\\':FilePath +xs) = ShowS +dedupBackslash (Char '\\'forall a. a -> [a] -> [a] :FilePath -xs) - dedupBackslash (Char -x:FilePath -xs) = Char -xforall a. a -> [a] -> [a] +xs) + dedupBackslash (Char +x:FilePath +xs) = Char +xforall a. a -> [a] -> [a] :ShowS -dedupBackslash FilePath -xs - dedupBackslash [] = [] +dedupBackslash FilePath +xs + dedupBackslash [] = [] \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Process.html b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Process.html index c906b05c..8bea9fe0 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Process.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Stock.IO.Process.html @@ -26,19 +26,19 @@ import qualified Control.Concurrent.Async as IO import qualified System.Process as IO -data TimedOut = TimedOut deriving (forall x. Rep TimedOut x -> TimedOut +data TimedOut = TimedOut deriving (forall x. Rep TimedOut x -> TimedOut forall x. TimedOut -> Rep TimedOut x forall a. (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep TimedOut x -> TimedOut $cfrom :: forall x. TimedOut -> Rep TimedOut x -Generic, TimedOut -> TimedOut -> Bool +Generic, TimedOut -> TimedOut -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: TimedOut -> TimedOut -> Bool $c/= :: TimedOut -> TimedOut -> Bool == :: TimedOut -> TimedOut -> Bool $c== :: TimedOut -> TimedOut -> Bool -Eq, Int -> TimedOut -> ShowS +Eq, Int -> TimedOut -> ShowS [TimedOut] -> ShowS TimedOut -> String forall a. @@ -55,14 +55,14 @@ :: ProcessHandle -> IO (Maybe ExitCode) maybeWaitForProcess :: ProcessHandle -> IO (Maybe ExitCode) -maybeWaitForProcess ProcessHandle -hProcess = +maybeWaitForProcess ProcessHandle +hProcess = forall e a. Exception e => IO a -> (e -> IO a) -> IO a catch (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap forall a. a -> Maybe a Just (ProcessHandle -> IO ExitCode IO.waitForProcess ProcessHandle -hProcess)) forall a b. (a -> b) -> a -> b +hProcess)) forall a b. (a -> b) -> a -> b $ \(AsyncCancelled _ :: AsyncCancelled) -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Maybe a @@ -73,13 +73,13 @@ -> ProcessHandle -> IO (Either TimedOut (Maybe ExitCode)) waitSecondsForProcess :: Int -> ProcessHandle -> IO (Either TimedOut (Maybe ExitCode)) -waitSecondsForProcess Int -seconds ProcessHandle -hProcess = forall a b. IO a -> IO b -> IO (Either a b) +waitSecondsForProcess Int +seconds ProcessHandle +hProcess = forall a b. IO a -> IO b -> IO (Either a b) IO.race (Int -> IO () IO.threadDelay (Int -seconds forall a. Num a => a -> a -> a +seconds forall a. Num a => a -> a -> a * Int 1000000) forall (m :: * -> *) a b. Monad m => m a -> m b -> m b >> forall (m :: * -> *) a. Monad m => a -> m a @@ -87,5 +87,5 @@ TimedOut) (ProcessHandle -> IO (Maybe ExitCode) maybeWaitForProcess ProcessHandle -hProcess) +hProcess) \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Stock.Monad.html b/hedgehog-extras/src/Hedgehog.Extras.Stock.Monad.html index bd0985db..2b6eab84 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Stock.Monad.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Stock.Monad.html @@ -6,7 +6,7 @@ import Control.Monad -- | Force the evaluation of the return value in a monadic computation. -forceM :: (Monad m, NFData a) => m a -> m a +forceM :: (Monad m, NFData a) => m a -> m a forceM :: forall (m :: * -> *) a. (Monad m, NFData a) => m a -> m a forceM = (forall a. NFData a => a -> a force forall (m :: * -> *) a b. Monad m => (a -> b) -> m a -> m b diff --git a/hedgehog-extras/src/Hedgehog.Extras.Stock.String.html b/hedgehog-extras/src/Hedgehog.Extras.Stock.String.html index 0dbde5cc..37f44193 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Stock.String.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Stock.String.html @@ -61,12 +61,12 @@ -- | Trim leading and trailing whitespace and read the string into a value. Report the read value in the test -- annotations. -readNoteM :: (Read a, Show a, H.MonadTest m, MonadCatch m, HasCallStack) => String -> m a +readNoteM :: (Read a, Show a, H.MonadTest m, MonadCatch m, HasCallStack) => String -> m a readNoteM :: forall a (m :: * -> *). (Read a, Show a, MonadTest m, MonadCatch m, HasCallStack) => String -> m a -readNoteM String -inputStr = +readNoteM String +inputStr = forall a. HasCallStack => (HasCallStack => a) -> a withFrozenCallStack forall a b. (a -> b) -> a -> b @@ -87,12 +87,12 @@ <> String ": " forall a. Semigroup a => a -> a -> a <> String -inputStr) +inputStr) forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Read a => String -> Either String a readEither forall a b. (a -> b) -> a -> b $ String -> String strip String -inputStr +inputStr \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Stock.Time.html b/hedgehog-extras/src/Hedgehog.Extras.Stock.Time.html index 6fff2229..2e2a79f9 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Stock.Time.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Stock.Time.html @@ -17,12 +17,12 @@ -- | Show 'UTCTime' in seconds since epoch showUTCTimeSeconds :: UTCTime -> String showUTCTimeSeconds :: UTCTime -> String -showUTCTimeSeconds UTCTime -time = forall a. Show a => a -> String +showUTCTimeSeconds UTCTime +time = forall a. Show a => a -> String show @Int64 (forall a b. (RealFrac a, Integral b) => a -> b floor (UTCTime -> POSIXTime DTC.utcTimeToPOSIXSeconds UTCTime -time)) +time)) -- | Format the given time as an ISO 8601 date-time string formatIso8601 :: UTCTime -> String diff --git a/hedgehog-extras/src/Hedgehog.Extras.Test.Base.html b/hedgehog-extras/src/Hedgehog.Extras.Test.Base.html index 8b956f73..5bb1b32e 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Test.Base.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Test.Base.html @@ -92,9 +92,9 @@ import Control.Monad.Catch (MonadCatch) import Control.Monad.Morph (hoist) import Control.Monad.Reader (MonadIO (..), MonadReader (ask)) -import Control.Monad.Trans.Resource (ReleaseKey, runResourceT) +import Control.Monad.Trans.Resource (MonadResource, ReleaseKey, register, runResourceT) import Data.Aeson (Result (..)) -import Data.Bool (Bool, (&&), otherwise) +import Data.Bool (Bool (..), otherwise, (&&)) import Data.Either (Either (..), either) import Data.Eq (Eq ((/=))) import Data.Foldable (for_) @@ -108,7 +108,7 @@ import Data.Time.Clock (NominalDiffTime, UTCTime) import Data.Traversable (Traversable) import Data.Tuple (snd) -import GHC.Stack (CallStack, HasCallStack) +import GHC.Stack import Hedgehog (MonadTest) import Hedgehog.Extras.Internal.Test.Integration (Integration, IntegrationState (..)) import Hedgehog.Extras.Stock.CallStack (callerModuleName) @@ -123,27 +123,30 @@ import qualified Control.Concurrent as IO import qualified Control.Concurrent.STM as STM -import qualified Control.Monad.Trans.Resource as IO -import qualified Data.List as L -import qualified Data.Time.Clock as DTC -import qualified GHC.Stack as GHC -import qualified Hedgehog as H -import qualified Hedgehog.Extras.Internal.Test.Integration as H -import qualified Hedgehog.Extras.Test.MonadAssertion as H -import qualified Hedgehog.Internal.Property as H -import qualified Hedgehog.Internal.Show as H -import qualified System.Directory as IO -import qualified System.Environment as IO -import qualified System.Info as IO -import qualified System.IO as IO -import qualified System.IO.Temp as IO - -{- HLINT ignore "Reduce duplication" -} - --- | Run a property with only one test. This is intended for allowing hedgehog --- to run unit tests. -propertyOnce :: HasCallStack => Integration () -> H.Property -propertyOnce :: HasCallStack => Integration () -> Property +import Control.Exception (IOException) +import Control.Monad.Catch (Handler (..)) +import qualified Control.Monad.Trans.Resource as IO +import qualified Control.Retry as R +import qualified Data.List as L +import qualified Data.Time.Clock as DTC +import qualified GHC.Stack as GHC +import qualified Hedgehog as H +import qualified Hedgehog.Extras.Internal.Test.Integration as H +import qualified Hedgehog.Extras.Test.MonadAssertion as H +import qualified Hedgehog.Internal.Property as H +import qualified Hedgehog.Internal.Show as H +import qualified System.Directory as IO +import qualified System.Environment as IO +import qualified System.Info as IO +import qualified System.IO as IO +import qualified System.IO.Temp as IO + +{- HLINT ignore "Reduce duplication" -} + +-- | Run a property with only one test. This is intended for allowing hedgehog +-- to run unit tests. +propertyOnce :: HasCallStack => Integration () -> H.Property +propertyOnce :: HasCallStack => Integration () -> Property propertyOnce = TestLimit -> Property -> Property H.withTests TestLimit 1 forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -163,16 +166,16 @@ MonadIO m => ReaderT IntegrationState m a -> m a H.runIntegrationReaderT - --- | Takes a 'CallStack' so the error can be rendered at the appropriate call site. -failWithCustom :: MonadTest m => CallStack -> Maybe Diff -> String -> m a -failWithCustom :: forall (m :: * -> *) a. + +-- | Takes a 'CallStack' so the error can be rendered at the appropriate call site. +failWithCustom :: MonadTest m => CallStack -> Maybe Diff -> String -> m a +failWithCustom :: forall (m :: * -> *) a. MonadTest m => CallStack -> Maybe Diff -> String -> m a -failWithCustom CallStack -cs Maybe Diff -mdiff String -msg = forall (m :: * -> *) a. MonadTest m => Test a -> m a +failWithCustom CallStack +cs Maybe Diff +mdiff String +msg = forall (m :: * -> *) a. MonadTest m => Test a -> m a liftTest forall a b. (a -> b) -> a -> b $ forall a. (Either Failure a, Journal) -> Test a mkTest (forall a b. a -> Either a b @@ -180,124 +183,162 @@ $ Maybe Span -> String -> Maybe Diff -> Failure H.Failure (CallStack -> Maybe Span getCaller CallStack -cs) String -msg Maybe Diff -mdiff, forall a. Monoid a => a +cs) String +msg Maybe Diff +mdiff, forall a. Monoid a => a mempty) - --- | Takes a 'CallStack' so the error can be rendered at the appropriate call site. -failMessage :: MonadTest m => CallStack -> String -> m a -failMessage :: forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a -failMessage CallStack -cs = forall (m :: * -> *) a. + +-- | Takes a 'CallStack' so the error can be rendered at the appropriate call site. +failMessage :: MonadTest m => CallStack -> String -> m a +failMessage :: forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a +failMessage CallStack +cs = forall (m :: * -> *) a. MonadTest m => CallStack -> Maybe Diff -> String -> m a failWithCustom CallStack -cs forall a. Maybe a +cs forall a. Maybe a Nothing - --- | Create a workspace directory which will exist for at least the duration of --- the supplied block. --- --- The directory will have the supplied prefix but contain a generated random --- suffix to prevent interference between tests + +-- | Create a workspace directory which will exist for at least the duration of +-- the supplied block. -- --- The directory will be deleted if the block succeeds, but left behind if --- the block fails. -workspace :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> (FilePath -> m ()) -> m () -workspace :: forall (m :: * -> *). -(MonadTest m, MonadIO m, HasCallStack) => +-- The directory will have the supplied prefix but contain a generated random +-- suffix to prevent interference between tests +-- +-- The directory will be deleted if the block succeeds, but left behind if +-- the block fails. +workspace + :: MonadTest m + => HasCallStack + => MonadResource m + => FilePath + -> (FilePath -> m ()) + -> m () +workspace :: forall (m :: * -> *). +(MonadTest m, HasCallStack, MonadResource m) => String -> (String -> m ()) -> m () -workspace String -prefixPath String -> m () -f = forall a. HasCallStack => (HasCallStack => a) -> a -GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b +workspace String +prefixPath String -> m () +f = forall a. HasCallStack => (HasCallStack => a) -> a +withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - String -systemTemp <- forall (m :: * -> *) a. + String +systemTemp <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO IO String IO.getCanonicalTemporaryDirectory - Maybe String -maybeKeepWorkspace <- forall (m :: * -> *) a. + Maybe String +maybeKeepWorkspace <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ String -> IO (Maybe String) IO.lookupEnv String "KEEP_WORKSPACE" - String -ws <- forall (m :: * -> *) a. + String +ws <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ String -> String -> IO String IO.createTempDirectory String -systemTemp forall a b. (a -> b) -> a -> b +systemTemp forall a b. (a -> b) -> a -> b $ String -prefixPath forall a. Semigroup a => a -> a -> a +prefixPath forall a. Semigroup a => a -> a -> a <> String "-test" - forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () + forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () H.annotate forall a b. (a -> b) -> a -> b $ String "Workspace: " forall a. Semigroup a => a -> a -> a <> String -ws - forall (m :: * -> *) a. +ws + forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ String -> String -> IO () IO.writeFile (String -ws String -> String -> String +ws String -> String -> String </> String "module") HasCallStack => String callerModuleName - String -> m () -f String -ws - forall (f :: * -> *). Applicative f => Bool -> f () -> f () + String -> m () +f String +ws + forall (f :: * -> *). Applicative f => Bool -> f () -> f () when (String IO.os forall a. Eq a => a -> a -> Bool /= String "mingw32" Bool -> Bool -> Bool && Maybe String -maybeKeepWorkspace forall a. Eq a => a -> a -> Bool +maybeKeepWorkspace forall a. Eq a => a -> a -> Bool /= forall a. a -> Maybe a Just String "1") forall a b. (a -> b) -> a -> b $ do - forall (m :: * -> *) a. -(MonadTest m, MonadIO m, HasCallStack) => -IO a -> m a -H.evalIO forall a b. (a -> b) -> a -> b + -- try to delete the directory 20 times, 100ms apart + let retryPolicy :: RetryPolicyM IO +retryPolicy = forall (m :: * -> *). Monad m => Int -> RetryPolicyM m +R.constantDelay Int +100000 forall a. Semigroup a => a -> a -> a +<> Int -> RetryPolicy +R.limitRetries Int +20 + -- retry only on IOExceptions + ioExH :: p -> Handler m Bool +ioExH p +_ = forall (m :: * -> *) a e. Exception e => (e -> m a) -> Handler m a +Handler forall a b. (a -> b) -> a -> b +$ \(IOException +_ :: IOException) -> forall (f :: * -> *) a. Applicative f => a -> f a +pure Bool +True + -- For some reason, the temporary directory removal sometimes fails. + -- Lets wrap this in MonadResource to try multiple times, during the cleanup, before we fail. + forall (f :: * -> *) a. Functor f => f a -> f () +void + forall b c a. (b -> c) -> (a -> b) -> a -> c +. forall (m :: * -> *). MonadResource m => IO () -> m ReleaseKey +register + forall b c a. (b -> c) -> (a -> b) -> a -> c +. forall (m :: * -> *) a. +(MonadIO m, MonadMask m) => +RetryPolicyM m +-> [RetryStatus -> Handler m Bool] -> (RetryStatus -> m a) -> m a +R.recovering RetryPolicyM IO +retryPolicy [forall {m :: * -> *} {p}. Applicative m => p -> Handler m Bool +ioExH] + forall b c a. (b -> c) -> (a -> b) -> a -> c +. forall a b. a -> b -> a +const + forall a b. (a -> b) -> a -> b $ String -> IO () IO.removePathForcibly String -ws - --- | Create a workspace directory which will exist for at least the duration of --- the supplied block. --- --- The directory will have the prefix as "$prefixPath/$moduleName" but contain a generated random --- suffix to prevent interference between tests --- --- The directory will be deleted if the block succeeds, but left behind if --- the block fails. --- --- The 'prefix' argument should not contain directory delimeters. -moduleWorkspace :: (MonadTest m, MonadIO m, HasCallStack) => String -> (FilePath -> m ()) -> m () -moduleWorkspace :: forall (m :: * -> *). -(MonadTest m, MonadIO m, HasCallStack) => +ws + +-- | Create a workspace directory which will exist for at least the duration of +-- the supplied block. +-- +-- The directory will have the prefix as "$prefixPath/$moduleName" but contain a generated random +-- suffix to prevent interference between tests +-- +-- The directory will be deleted if the block succeeds, but left behind if +-- the block fails. +-- +-- The 'prefix' argument should not contain directory delimeters. +moduleWorkspace :: (MonadTest m, MonadResource m, HasCallStack) => String -> (FilePath -> m ()) -> m () +moduleWorkspace :: forall (m :: * -> *). +(MonadTest m, MonadResource m, HasCallStack) => String -> (String -> m ()) -> m () -moduleWorkspace String -prefix String -> m () -f = forall a. HasCallStack => (HasCallStack => a) -> a +moduleWorkspace String +prefix String -> m () +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - let srcModule :: String -srcModule = forall b a. b -> (a -> b) -> Maybe a -> b + let srcModule :: String +srcModule = forall b a. b -> (a -> b) -> Maybe a -> b maybe String "UnknownModule" (SrcLoc -> String GHC.srcLocModule forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -306,1075 +347,1075 @@ listToMaybe (CallStack -> [(String, SrcLoc)] GHC.getCallStack HasCallStack => CallStack GHC.callStack)) - forall (m :: * -> *). -(MonadTest m, MonadIO m, HasCallStack) => + forall (m :: * -> *). +(MonadTest m, HasCallStack, MonadResource m) => String -> (String -> m ()) -> m () workspace (String -prefix forall a. Semigroup a => a -> a -> a +prefix forall a. Semigroup a => a -> a -> a <> String "-" forall a. Semigroup a => a -> a -> a <> String -srcModule) String -> m () -f - --- | Annotate the given string at the context supplied by the callstack. -noteWithCallstack :: MonadTest m => CallStack -> String -> m () -noteWithCallstack :: forall (m :: * -> *). MonadTest m => CallStack -> String -> m () -noteWithCallstack CallStack -cs String -a = forall (m :: * -> *). MonadTest m => Log -> m () +srcModule) String -> m () +f + +-- | Annotate the given string at the context supplied by the callstack. +noteWithCallstack :: MonadTest m => CallStack -> String -> m () +noteWithCallstack :: forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +noteWithCallstack CallStack +cs String +a = forall (m :: * -> *). MonadTest m => Log -> m () H.writeLog forall a b. (a -> b) -> a -> b $ Maybe Span -> String -> Log H.Annotation (CallStack -> Maybe Span getCaller CallStack -cs) String -a - --- | Annotate with the given string. -note :: (MonadTest m, HasCallStack) => String -> m String -note :: forall (m :: * -> *). +cs) String +a + +-- | Annotate with the given string. +note :: (MonadTest m, HasCallStack) => String -> m String +note :: forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m String -note String -a = forall a. HasCallStack => (HasCallStack => a) -> a +note String +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !String -b <- forall (m :: * -> *) a. (MonadTest m, HasCallStack) => a -> m a + !String +b <- forall (m :: * -> *) a. (MonadTest m, HasCallStack) => a -> m a H.eval String -a - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +a + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack String -b - forall (m :: * -> *) a. Monad m => a -> m a +b + forall (m :: * -> *) a. Monad m => a -> m a return String -b - --- | Annotate the given string returning unit. -note_ :: (MonadTest m, HasCallStack) => String -> m () -note_ :: forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () -note_ String -a = forall a. HasCallStack => (HasCallStack => a) -> a +b + +-- | Annotate the given string returning unit. +note_ :: (MonadTest m, HasCallStack) => String -> m () +note_ :: forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () +note_ String +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack String -a - --- | Annotate the given string in a monadic context. -noteM :: (MonadTest m, MonadCatch m, HasCallStack) => m String -> m String -noteM :: forall (m :: * -> *). +a + +-- | Annotate the given string in a monadic context. +noteM :: (MonadTest m, MonadCatch m, HasCallStack) => m String -> m String +noteM :: forall (m :: * -> *). (MonadTest m, MonadCatch m, HasCallStack) => m String -> m String -noteM m String -a = forall a. HasCallStack => (HasCallStack => a) -> a +noteM m String +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !String -b <- forall (m :: * -> *) a. + !String +b <- forall (m :: * -> *) a. (MonadTest m, MonadCatch m, HasCallStack) => m a -> m a H.evalM m String -a - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +a + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack String -b - forall (m :: * -> *) a. Monad m => a -> m a +b + forall (m :: * -> *) a. Monad m => a -> m a return String -b - --- | Annotate the given string in a monadic context returning unit. -noteM_ :: (MonadTest m, MonadCatch m, HasCallStack) => m String -> m () -noteM_ :: forall (m :: * -> *). +b + +-- | Annotate the given string in a monadic context returning unit. +noteM_ :: (MonadTest m, MonadCatch m, HasCallStack) => m String -> m () +noteM_ :: forall (m :: * -> *). (MonadTest m, MonadCatch m, HasCallStack) => m String -> m () -noteM_ m String -a = forall a. HasCallStack => (HasCallStack => a) -> a +noteM_ m String +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !String -b <- forall (m :: * -> *) a. + !String +b <- forall (m :: * -> *) a. (MonadTest m, MonadCatch m, HasCallStack) => m a -> m a H.evalM m String -a - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +a + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack String -b - forall (m :: * -> *) a. Monad m => a -> m a +b + forall (m :: * -> *) a. Monad m => a -> m a return () - --- | Annotate the given string in IO. -noteIO :: (MonadTest m, MonadIO m, HasCallStack) => IO String -> m String -noteIO :: forall (m :: * -> *). + +-- | Annotate the given string in IO. +noteIO :: (MonadTest m, MonadIO m, HasCallStack) => IO String -> m String +noteIO :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => IO String -> m String -noteIO IO String -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteIO IO String +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !String -a <- forall (m :: * -> *) a. + !String +a <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO IO String -f - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +f + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack String -a - forall (m :: * -> *) a. Monad m => a -> m a +a + forall (m :: * -> *) a. Monad m => a -> m a return String -a - --- | Annotate the given string in IO returning unit. -noteIO_ :: (MonadTest m, MonadIO m, HasCallStack) => IO String -> m () -noteIO_ :: forall (m :: * -> *). +a + +-- | Annotate the given string in IO returning unit. +noteIO_ :: (MonadTest m, MonadIO m, HasCallStack) => IO String -> m () +noteIO_ :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => IO String -> m () -noteIO_ IO String -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteIO_ IO String +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !String -a <- forall (m :: * -> *) a. + !String +a <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO IO String -f - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +f + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack String -a - forall (m :: * -> *) a. Monad m => a -> m a +a + forall (m :: * -> *) a. Monad m => a -> m a return () - --- | Annotate the given value. -noteShow :: (MonadTest m, HasCallStack, Show a) => a -> m a -noteShow :: forall (m :: * -> *) a. + +-- | Annotate the given value. +noteShow :: (MonadTest m, HasCallStack, Show a) => a -> m a +noteShow :: forall (m :: * -> *) a. (MonadTest m, HasCallStack, Show a) => a -> m a -noteShow a -a = forall a. HasCallStack => (HasCallStack => a) -> a +noteShow a +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !a -b <- forall (m :: * -> *) a. (MonadTest m, HasCallStack) => a -> m a + !a +b <- forall (m :: * -> *) a. (MonadTest m, HasCallStack) => a -> m a H.eval a -a - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +a + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String show a -b) - forall (m :: * -> *) a. Monad m => a -> m a +b) + forall (m :: * -> *) a. Monad m => a -> m a return a -b - --- | Annotate the given value, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteShowPretty :: (MonadTest m, HasCallStack, Show a) => a -> m a -noteShowPretty :: forall (m :: * -> *) a. +b + +-- | Annotate the given value, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteShowPretty :: (MonadTest m, HasCallStack, Show a) => a -> m a +noteShowPretty :: forall (m :: * -> *) a. (MonadTest m, HasCallStack, Show a) => a -> m a -noteShowPretty a -a = forall a. HasCallStack => (HasCallStack => a) -> a +noteShowPretty a +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !a -b <- forall (m :: * -> *) a. (MonadTest m, HasCallStack) => a -> m a + !a +b <- forall (m :: * -> *) a. (MonadTest m, HasCallStack) => a -> m a H.eval a -a - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +a + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String H.showPretty a -b) - forall (m :: * -> *) a. Monad m => a -> m a +b) + forall (m :: * -> *) a. Monad m => a -> m a return a -b - --- | Annotate the given value returning unit. -noteShow_ :: (MonadTest m, HasCallStack, Show a) => a -> m () -noteShow_ :: forall (m :: * -> *) a. +b + +-- | Annotate the given value returning unit. +noteShow_ :: (MonadTest m, HasCallStack, Show a) => a -> m () +noteShow_ :: forall (m :: * -> *) a. (MonadTest m, HasCallStack, Show a) => a -> m () -noteShow_ a -a = forall a. HasCallStack => (HasCallStack => a) -> a +noteShow_ a +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String show a -a) - --- | Annotate the given value returning unit, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteShowPretty_ :: (MonadTest m, HasCallStack, Show a) => a -> m () -noteShowPretty_ :: forall (m :: * -> *) a. +a) + +-- | Annotate the given value returning unit, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteShowPretty_ :: (MonadTest m, HasCallStack, Show a) => a -> m () +noteShowPretty_ :: forall (m :: * -> *) a. (MonadTest m, HasCallStack, Show a) => a -> m () -noteShowPretty_ a -a = forall a. HasCallStack => (HasCallStack => a) -> a +noteShowPretty_ a +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String H.showPretty a -a) - --- | Annotate the given value in a monadic context. -noteShowM :: (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m a -noteShowM :: forall (m :: * -> *) a. +a) + +-- | Annotate the given value in a monadic context. +noteShowM :: (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m a +noteShowM :: forall (m :: * -> *) a. (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m a -noteShowM m a -a = forall a. HasCallStack => (HasCallStack => a) -> a +noteShowM m a +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !a -b <- forall (m :: * -> *) a. + !a +b <- forall (m :: * -> *) a. (MonadTest m, MonadCatch m, HasCallStack) => m a -> m a H.evalM m a -a - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +a + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String show a -b) - forall (m :: * -> *) a. Monad m => a -> m a +b) + forall (m :: * -> *) a. Monad m => a -> m a return a -b - --- | Annotate the given value in a monadic context, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteShowPrettyM :: (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m a -noteShowPrettyM :: forall (m :: * -> *) a. +b + +-- | Annotate the given value in a monadic context, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteShowPrettyM :: (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m a +noteShowPrettyM :: forall (m :: * -> *) a. (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m a -noteShowPrettyM m a -a = forall a. HasCallStack => (HasCallStack => a) -> a +noteShowPrettyM m a +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !a -b <- forall (m :: * -> *) a. + !a +b <- forall (m :: * -> *) a. (MonadTest m, MonadCatch m, HasCallStack) => m a -> m a H.evalM m a -a - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +a + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String H.showPretty a -b) - forall (m :: * -> *) a. Monad m => a -> m a +b) + forall (m :: * -> *) a. Monad m => a -> m a return a -b - --- | Annotate the given value in a monadic context returning unit. -noteShowM_ :: (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m () -noteShowM_ :: forall (m :: * -> *) a. +b + +-- | Annotate the given value in a monadic context returning unit. +noteShowM_ :: (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m () +noteShowM_ :: forall (m :: * -> *) a. (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m () -noteShowM_ m a -a = forall a. HasCallStack => (HasCallStack => a) -> a +noteShowM_ m a +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !a -b <- forall (m :: * -> *) a. + !a +b <- forall (m :: * -> *) a. (MonadTest m, MonadCatch m, HasCallStack) => m a -> m a H.evalM m a -a - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +a + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String show a -b) - forall (m :: * -> *) a. Monad m => a -> m a +b) + forall (m :: * -> *) a. Monad m => a -> m a return () - --- | Annotate the given value in a monadic context returning unit, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteShowPrettyM_ :: (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m () -noteShowPrettyM_ :: forall (m :: * -> *) a. + +-- | Annotate the given value in a monadic context returning unit, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteShowPrettyM_ :: (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m () +noteShowPrettyM_ :: forall (m :: * -> *) a. (MonadTest m, MonadCatch m, HasCallStack, Show a) => m a -> m () -noteShowPrettyM_ m a -a = forall a. HasCallStack => (HasCallStack => a) -> a +noteShowPrettyM_ m a +a = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !a -b <- forall (m :: * -> *) a. + !a +b <- forall (m :: * -> *) a. (MonadTest m, MonadCatch m, HasCallStack) => m a -> m a H.evalM m a -a - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +a + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String H.showPretty a -b) - forall (m :: * -> *) a. Monad m => a -> m a +b) + forall (m :: * -> *) a. Monad m => a -> m a return () - --- | Annotate the given value in IO. -noteShowIO :: (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m a -noteShowIO :: forall (m :: * -> *) a. + +-- | Annotate the given value in IO. +noteShowIO :: (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m a +noteShowIO :: forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m a -noteShowIO IO a -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteShowIO IO a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !a -a <- forall (m :: * -> *) a. + !a +a <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO IO a -f - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +f + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String show a -a) - forall (m :: * -> *) a. Monad m => a -> m a +a) + forall (m :: * -> *) a. Monad m => a -> m a return a -a - --- | Annotate the given value in IO, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteShowPrettyIO :: (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m a -noteShowPrettyIO :: forall (m :: * -> *) a. +a + +-- | Annotate the given value in IO, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteShowPrettyIO :: (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m a +noteShowPrettyIO :: forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m a -noteShowPrettyIO IO a -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteShowPrettyIO IO a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !a -a <- forall (m :: * -> *) a. + !a +a <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO IO a -f - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +f + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String H.showPretty a -a) - forall (m :: * -> *) a. Monad m => a -> m a +a) + forall (m :: * -> *) a. Monad m => a -> m a return a -a - --- | Annotate the given value in IO returning unit. -noteShowIO_ :: (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m () -noteShowIO_ :: forall (m :: * -> *) a. +a + +-- | Annotate the given value in IO returning unit. +noteShowIO_ :: (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m () +noteShowIO_ :: forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m () -noteShowIO_ IO a -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteShowIO_ IO a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !a -a <- forall (m :: * -> *) a. + !a +a <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO IO a -f - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +f + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String show a -a) - forall (m :: * -> *) a. Monad m => a -> m a +a) + forall (m :: * -> *) a. Monad m => a -> m a return () - --- | Annotate the given value in IO returning unit, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteShowPrettyIO_ :: (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m () -noteShowPrettyIO_ :: forall (m :: * -> *) a. + +-- | Annotate the given value in IO returning unit, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteShowPrettyIO_ :: (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m () +noteShowPrettyIO_ :: forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m () -noteShowPrettyIO_ IO a -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteShowPrettyIO_ IO a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !a -a <- forall (m :: * -> *) a. + !a +a <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO IO a -f - forall (m :: * -> *). MonadTest m => CallStack -> String -> m () +f + forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> String H.showPretty a -a) - forall (m :: * -> *) a. Monad m => a -> m a +a) + forall (m :: * -> *) a. Monad m => a -> m a return () - --- | Annotate the each value in the given traversable. -noteEach :: (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m (f a) -noteEach :: forall (m :: * -> *) a (f :: * -> *). + +-- | Annotate the each value in the given traversable. +noteEach :: (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m (f a) +noteEach :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m (f a) -noteEach f a -as = forall a. HasCallStack => (HasCallStack => a) -> a +noteEach f a +as = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - forall (t :: * -> *) (f :: * -> *) a b. + forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String show - forall (m :: * -> *) a. Monad m => a -> m a + forall (m :: * -> *) a. Monad m => a -> m a return f a -as - --- | Annotate the each value in the given traversable, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteEachPretty :: (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m (f a) -noteEachPretty :: forall (m :: * -> *) a (f :: * -> *). +as + +-- | Annotate the each value in the given traversable, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteEachPretty :: (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m (f a) +noteEachPretty :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m (f a) -noteEachPretty f a -as = forall a. HasCallStack => (HasCallStack => a) -> a +noteEachPretty f a +as = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - forall (t :: * -> *) (f :: * -> *) a b. + forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String H.showPretty - forall (m :: * -> *) a. Monad m => a -> m a + forall (m :: * -> *) a. Monad m => a -> m a return f a -as - --- | Annotate the each value in the given traversable returning unit. -noteEach_ :: (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m () -noteEach_ :: forall (m :: * -> *) a (f :: * -> *). +as + +-- | Annotate the each value in the given traversable returning unit. +noteEach_ :: (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m () +noteEach_ :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m () -noteEach_ f a -as = forall a. HasCallStack => (HasCallStack => a) -> a +noteEach_ f a +as = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String show - --- | Annotate the each value in the given traversable returning unit, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteEachPretty_ :: (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m () -noteEachPretty_ :: forall (m :: * -> *) a (f :: * -> *). + +-- | Annotate the each value in the given traversable returning unit, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteEachPretty_ :: (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m () +noteEachPretty_ :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, HasCallStack, Show a, Traversable f) => f a -> m () -noteEachPretty_ f a -as = forall a. HasCallStack => (HasCallStack => a) -> a +noteEachPretty_ f a +as = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String H.showPretty - --- | Annotate the each value in the given traversable in a monadic context. -noteEachM :: (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m (f a) -noteEachM :: forall (m :: * -> *) a (f :: * -> *). + +-- | Annotate the each value in the given traversable in a monadic context. +noteEachM :: (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m (f a) +noteEachM :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m (f a) -noteEachM m (f a) -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteEachM m (f a) +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !f a -as <- m (f a) -f - forall (t :: * -> *) (f :: * -> *) a b. + !f a +as <- m (f a) +f + forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String show - forall (m :: * -> *) a. Monad m => a -> m a + forall (m :: * -> *) a. Monad m => a -> m a return f a -as - --- | Annotate the each value in the given traversable in a monadic context, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteEachPrettyM :: (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m (f a) -noteEachPrettyM :: forall (m :: * -> *) a (f :: * -> *). +as + +-- | Annotate the each value in the given traversable in a monadic context, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteEachPrettyM :: (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m (f a) +noteEachPrettyM :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m (f a) -noteEachPrettyM m (f a) -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteEachPrettyM m (f a) +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !f a -as <- m (f a) -f - forall (t :: * -> *) (f :: * -> *) a b. + !f a +as <- m (f a) +f + forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String H.showPretty - forall (m :: * -> *) a. Monad m => a -> m a + forall (m :: * -> *) a. Monad m => a -> m a return f a -as - --- | Annotate the each value in the given traversable in a monadic context returning unit. -noteEachM_ :: (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m () -noteEachM_ :: forall (m :: * -> *) a (f :: * -> *). +as + +-- | Annotate the each value in the given traversable in a monadic context returning unit. +noteEachM_ :: (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m () +noteEachM_ :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m () -noteEachM_ m (f a) -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteEachM_ m (f a) +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !f a -as <- m (f a) -f - forall (t :: * -> *) (f :: * -> *) a b. + !f a +as <- m (f a) +f + forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String show - --- | Annotate the each value in the given traversable in a monadic context returning unit, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteEachPrettyM_ :: (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m () -noteEachPrettyM_ :: forall (m :: * -> *) a (f :: * -> *). + +-- | Annotate the each value in the given traversable in a monadic context returning unit, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteEachPrettyM_ :: (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m () +noteEachPrettyM_ :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, HasCallStack, Show a, Traversable f) => m (f a) -> m () -noteEachPrettyM_ m (f a) -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteEachPrettyM_ m (f a) +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !f a -as <- m (f a) -f - forall (t :: * -> *) (f :: * -> *) a b. + !f a +as <- m (f a) +f + forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String H.showPretty - --- | Annotate the each value in the given traversable in IO. -noteEachIO :: (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m (f a) -noteEachIO :: forall (m :: * -> *) a (f :: * -> *). + +-- | Annotate the each value in the given traversable in IO. +noteEachIO :: (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m (f a) +noteEachIO :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m (f a) -noteEachIO IO (f a) -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteEachIO IO (f a) +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !f a -as <- forall (m :: * -> *) a. + !f a +as <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO IO (f a) -f - forall (t :: * -> *) (f :: * -> *) a b. +f + forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String show - forall (m :: * -> *) a. Monad m => a -> m a + forall (m :: * -> *) a. Monad m => a -> m a return f a -as - --- | Annotate the each value in the given traversable in IO, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteEachPrettyIO :: (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m (f a) -noteEachPrettyIO :: forall (m :: * -> *) a (f :: * -> *). +as + +-- | Annotate the each value in the given traversable in IO, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteEachPrettyIO :: (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m (f a) +noteEachPrettyIO :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m (f a) -noteEachPrettyIO IO (f a) -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteEachPrettyIO IO (f a) +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !f a -as <- forall (m :: * -> *) a. + !f a +as <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO IO (f a) -f - forall (t :: * -> *) (f :: * -> *) a b. +f + forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String H.showPretty - forall (m :: * -> *) a. Monad m => a -> m a + forall (m :: * -> *) a. Monad m => a -> m a return f a -as - --- | Annotate the each value in the given traversable in IO returning unit. -noteEachIO_ :: (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m () -noteEachIO_ :: forall (m :: * -> *) a (f :: * -> *). +as + +-- | Annotate the each value in the given traversable in IO returning unit. +noteEachIO_ :: (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m () +noteEachIO_ :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m () -noteEachIO_ IO (f a) -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteEachIO_ IO (f a) +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !f a -as <- forall (m :: * -> *) a. + !f a +as <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO IO (f a) -f - forall (t :: * -> *) (f :: * -> *) a b. +f + forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String show - --- | Annotate the each value in the given traversable in IO returning unit, pretty printing it with indentation. Note that large data structures will take --- a significant amount of vertical screen space. -noteEachPrettyIO_ :: (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m () -noteEachPrettyIO_ :: forall (m :: * -> *) a (f :: * -> *). + +-- | Annotate the each value in the given traversable in IO returning unit, pretty printing it with indentation. Note that large data structures will take +-- a significant amount of vertical screen space. +noteEachPrettyIO_ :: (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m () +noteEachPrettyIO_ :: forall (m :: * -> *) a (f :: * -> *). (MonadTest m, MonadIO m, HasCallStack, Show a, Traversable f) => IO (f a) -> m () -noteEachPrettyIO_ IO (f a) -f = forall a. HasCallStack => (HasCallStack => a) -> a +noteEachPrettyIO_ IO (f a) +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !f a -as <- forall (m :: * -> *) a. + !f a +as <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO IO (f a) -f - forall (t :: * -> *) (f :: * -> *) a b. +f + forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ f a -as forall a b. (a -> b) -> a -> b +as forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadTest m => CallStack -> String -> m () noteWithCallstack HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Show a => a -> String H.showPretty - --- | Return the test file path after annotating it relative to the project root directory -noteTempFile :: (MonadTest m, HasCallStack) => FilePath -> FilePath -> m FilePath -noteTempFile :: forall (m :: * -> *). + +-- | Return the test file path after annotating it relative to the project root directory +noteTempFile :: (MonadTest m, HasCallStack) => FilePath -> FilePath -> m FilePath +noteTempFile :: forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> String -> m String -noteTempFile String -tempDir String -filePath = forall a. HasCallStack => (HasCallStack => a) -> a +noteTempFile String +tempDir String +filePath = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - let relPath :: String -relPath = String -tempDir String -> String -> String + let relPath :: String +relPath = String +tempDir String -> String -> String </> String -filePath - forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () +filePath + forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () H.annotate String -relPath - forall (m :: * -> *) a. Monad m => a -> m a +relPath + forall (m :: * -> *) a. Monad m => a -> m a return String -relPath - --- | Fail when the result is Nothing. -nothingFail :: (MonadTest m, HasCallStack) => Maybe a -> m a -nothingFail :: forall (m :: * -> *) a. +relPath + +-- | Fail when the result is Nothing. +nothingFail :: (MonadTest m, HasCallStack) => Maybe a -> m a +nothingFail :: forall (m :: * -> *) a. (MonadTest m, HasCallStack) => Maybe a -> m a -nothingFail Maybe a -r = forall a. HasCallStack => (HasCallStack => a) -> a +nothingFail Maybe a +r = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ case Maybe a -r of - Just a -a -> forall (m :: * -> *) a. Monad m => a -> m a +r of + Just a +a -> forall (m :: * -> *) a. Monad m => a -> m a return a -a - Maybe a +a + Maybe a Nothing -> forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a failMessage HasCallStack => CallStack GHC.callStack String "Expected Just" - --- | Fail when the computed result is Nothing. -nothingFailM :: (MonadTest m, HasCallStack) => m (Maybe a) -> m a -nothingFailM :: forall (m :: * -> *) a. + +-- | Fail when the computed result is Nothing. +nothingFailM :: (MonadTest m, HasCallStack) => m (Maybe a) -> m a +nothingFailM :: forall (m :: * -> *) a. (MonadTest m, HasCallStack) => m (Maybe a) -> m a -nothingFailM m (Maybe a) -f = forall a. HasCallStack => (HasCallStack => a) -> a +nothingFailM m (Maybe a) +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ m (Maybe a) -f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall (m :: * -> *) a. (MonadTest m, HasCallStack) => Maybe a -> m a nothingFail - --- | Fail when the result is Left. -leftFail :: (MonadTest m, Show e, HasCallStack) => Either e a -> m a -leftFail :: forall (m :: * -> *) e a. + +-- | Fail when the result is Left. +leftFail :: (MonadTest m, Show e, HasCallStack) => Either e a -> m a +leftFail :: forall (m :: * -> *) e a. (MonadTest m, Show e, HasCallStack) => Either e a -> m a -leftFail Either e a -r = forall a. HasCallStack => (HasCallStack => a) -> a +leftFail Either e a +r = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ case Either e a -r of - Right a -a -> forall (m :: * -> *) a. Monad m => a -> m a +r of + Right a +a -> forall (m :: * -> *) a. Monad m => a -> m a return a -a - Left e -e -> forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a +a + Left e +e -> forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a failMessage HasCallStack => CallStack GHC.callStack (String "Expected Right: " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> String show e -e) - --- | Fail when the computed result is Left. -leftFailM :: (MonadTest m, Show e, HasCallStack) => m (Either e a) -> m a -leftFailM :: forall (m :: * -> *) e a. +e) + +-- | Fail when the computed result is Left. +leftFailM :: (MonadTest m, Show e, HasCallStack) => m (Either e a) -> m a +leftFailM :: forall (m :: * -> *) e a. (MonadTest m, Show e, HasCallStack) => m (Either e a) -> m a -leftFailM m (Either e a) -f = forall a. HasCallStack => (HasCallStack => a) -> a +leftFailM m (Either e a) +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ m (Either e a) -f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall (m :: * -> *) e a. (MonadTest m, Show e, HasCallStack) => Either e a -> m a leftFail - -maybeAt :: Int -> [a] -> Maybe a -maybeAt :: forall a. Int -> [a] -> Maybe a -maybeAt Int -n [a] -xs - | Int -n forall a. Ord a => a -> a -> Bool + +maybeAt :: Int -> [a] -> Maybe a +maybeAt :: forall a. Int -> [a] -> Maybe a +maybeAt Int +n [a] +xs + | Int +n forall a. Ord a => a -> a -> Bool < Int 0 = forall a. Maybe a Nothing - | Bool + | Bool otherwise = forall (t :: * -> *) a b. Foldable t => (a -> b -> b) -> b -> t a -> b L.foldr forall a. a -> (Int -> Maybe a) -> Int -> Maybe a -go (forall a b. a -> b -> a +go (forall a b. a -> b -> a const forall a. Maybe a Nothing) [a] -xs Int -n - where - go :: a -> (Int -> Maybe a) -> Int -> Maybe a - go :: forall a. a -> (Int -> Maybe a) -> Int -> Maybe a -go a -x Int -> Maybe a -r Int -k = - case Int -k of - Int +xs Int +n + where + go :: a -> (Int -> Maybe a) -> Int -> Maybe a + go :: forall a. a -> (Int -> Maybe a) -> Int -> Maybe a +go a +x Int -> Maybe a +r Int +k = + case Int +k of + Int 0 -> forall a. a -> Maybe a Just a -x - Int +x + Int _ -> Int -> Maybe a -r (Int -k forall a. Num a => a -> a -> a +r (Int +k forall a. Num a => a -> a -> a - Int 1) - -headM :: (MonadTest m, HasCallStack) => [a] -> m a -headM :: forall (m :: * -> *) a. (MonadTest m, HasCallStack) => [a] -> m a -headM (a -a:[a] + +headM :: (MonadTest m, HasCallStack) => [a] -> m a +headM :: forall (m :: * -> *) a. (MonadTest m, HasCallStack) => [a] -> m a +headM (a +a:[a] _) = forall (m :: * -> *) a. Monad m => a -> m a return a -a -headM [] = forall a. HasCallStack => (HasCallStack => a) -> a +a +headM [] = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a failMessage HasCallStack => CallStack GHC.callStack String "Cannot take head of empty list" - -indexM :: (MonadTest m, HasCallStack) => Int -> [a] -> m a -indexM :: forall (m :: * -> *) a. + +indexM :: (MonadTest m, HasCallStack) => Int -> [a] -> m a +indexM :: forall (m :: * -> *) a. (MonadTest m, HasCallStack) => Int -> [a] -> m a -indexM Int -n [a] -xs = - case forall a. Int -> [a] -> Maybe a +indexM Int +n [a] +xs = + case forall a. Int -> [a] -> Maybe a maybeAt Int -n [a] -xs of - Just a -x -> forall (f :: * -> *) a. Applicative f => a -> f a +n [a] +xs of + Just a +x -> forall (f :: * -> *) a. Applicative f => a -> f a pure a -x - Maybe a +x + Maybe a Nothing -> - forall a. HasCallStack => (HasCallStack => a) -> a + forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ - forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a + forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a failMessage HasCallStack => CallStack GHC.callStack forall a b. (a -> b) -> a -> b $ String "Cannot get index " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> String show Int -n forall a. Semigroup a => a -> a -> a +n forall a. Semigroup a => a -> a -> a <> String " of list of length " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> String show (forall (t :: * -> *) a. Foldable t => t a -> Int L.length [a] -xs) - -onLeft :: Monad m => (e -> m a) -> m (Either e a) -> m a -onLeft :: forall (m :: * -> *) e a. +xs) + +onLeft :: Monad m => (e -> m a) -> m (Either e a) -> m a +onLeft :: forall (m :: * -> *) e a. Monad m => (e -> m a) -> m (Either e a) -> m a -onLeft e -> m a -h m (Either e a) -f = m (Either e a) -f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +onLeft e -> m a +h m (Either e a) +f = m (Either e a) +f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall a c b. (a -> c) -> (b -> c) -> Either a b -> c either e -> m a -h forall (f :: * -> *) a. Applicative f => a -> f a +h forall (f :: * -> *) a. Applicative f => a -> f a pure - -onNothing :: Monad m => m a -> m (Maybe a) -> m a -onNothing :: forall (m :: * -> *) a. Monad m => m a -> m (Maybe a) -> m a -onNothing m a -h m (Maybe a) -f = m (Maybe a) -f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b + +onNothing :: Monad m => m a -> m (Maybe a) -> m a +onNothing :: forall (m :: * -> *) a. Monad m => m a -> m (Maybe a) -> m a +onNothing m a +h m (Maybe a) +f = m (Maybe a) +f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall b a. b -> (a -> b) -> Maybe a -> b maybe m a -h forall (f :: * -> *) a. Applicative f => a -> f a +h forall (f :: * -> *) a. Applicative f => a -> f a pure - --- | Index into a list. On failure, a friendly message is included in the test report. -fromJustM :: (MonadTest m, HasCallStack) => Maybe a -> m a -fromJustM :: forall (m :: * -> *) a. + +-- | Index into a list. On failure, a friendly message is included in the test report. +fromJustM :: (MonadTest m, HasCallStack) => Maybe a -> m a +fromJustM :: forall (m :: * -> *) a. (MonadTest m, HasCallStack) => Maybe a -> m a -fromJustM (Just a -a) = forall (m :: * -> *) a. Monad m => a -> m a +fromJustM (Just a +a) = forall (m :: * -> *) a. Monad m => a -> m a return a -a -fromJustM Maybe a +a +fromJustM Maybe a Nothing = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a failMessage HasCallStack => CallStack GHC.callStack String "Cannot take head of empty list" - --- | Fail when the result is Error. -jsonErrorFail :: (MonadTest m, HasCallStack) => Result a -> m a -jsonErrorFail :: forall (m :: * -> *) a. + +-- | Fail when the result is Error. +jsonErrorFail :: (MonadTest m, HasCallStack) => Result a -> m a +jsonErrorFail :: forall (m :: * -> *) a. (MonadTest m, HasCallStack) => Result a -> m a -jsonErrorFail Result a -r = forall a. HasCallStack => (HasCallStack => a) -> a +jsonErrorFail Result a +r = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ case Result a -r of - Success a -a -> forall (m :: * -> *) a. Monad m => a -> m a +r of + Success a +a -> forall (m :: * -> *) a. Monad m => a -> m a return a -a - Error String -msg -> forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a +a + Error String +msg -> forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a failMessage HasCallStack => CallStack GHC.callStack (String "Expected Right: " forall a. Semigroup a => a -> a -> a <> String -msg) - --- | Fail when the computed result is Error. -jsonErrorFailM :: (MonadTest m, HasCallStack) => m (Result a) -> m a -jsonErrorFailM :: forall (m :: * -> *) a. +msg) + +-- | Fail when the computed result is Error. +jsonErrorFailM :: (MonadTest m, HasCallStack) => m (Result a) -> m a +jsonErrorFailM :: forall (m :: * -> *) a. (MonadTest m, HasCallStack) => m (Result a) -> m a -jsonErrorFailM m (Result a) -f = forall a. HasCallStack => (HasCallStack => a) -> a +jsonErrorFailM m (Result a) +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ m (Result a) -f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall (m :: * -> *) a. (MonadTest m, HasCallStack) => Result a -> m a jsonErrorFail - --- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. --- --- Expiration of the deadline results in an assertion failure -byDeadlineIO :: (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> UTCTime -> String -> IO a -> m a -byDeadlineIO :: forall (m :: * -> *) a. + +-- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. +-- +-- Expiration of the deadline results in an assertion failure +byDeadlineIO :: (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> UTCTime -> String -> IO a -> m a +byDeadlineIO :: forall (m :: * -> *) a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> UTCTime -> String -> IO a -> m a -byDeadlineIO NominalDiffTime -period UTCTime -deadline String -errorMessage IO a -f = forall a. HasCallStack => (HasCallStack => a) -> a +byDeadlineIO NominalDiffTime +period UTCTime +deadline String +errorMessage IO a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> UTCTime -> String -> m a -> m a byDeadlineM NominalDiffTime -period UTCTime -deadline String -errorMessage forall a b. (a -> b) -> a -> b +period UTCTime +deadline String +errorMessage forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO a -f - --- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. --- --- Expiration of the deadline results in an assertion failure -byDeadlineM :: forall m a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> UTCTime -> String -> m a -> m a -byDeadlineM :: forall (m :: * -> *) a. +f + +-- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. +-- +-- Expiration of the deadline results in an assertion failure +byDeadlineM :: forall m a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> UTCTime -> String -> m a -> m a +byDeadlineM :: forall (m :: * -> *) a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> UTCTime -> String -> m a -> m a -byDeadlineM NominalDiffTime -period UTCTime -deadline String -errorMessage m a -f = forall a. HasCallStack => (HasCallStack => a) -> a +byDeadlineM NominalDiffTime +period UTCTime +deadline String +errorMessage m a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - UTCTime -start <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + UTCTime +start <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO UTCTime DTC.getCurrentTime - a -a <- m a -goM - UTCTime -end <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + a +a <- m a +goM + UTCTime +end <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO UTCTime DTC.getCurrentTime - forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () + forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () note_ forall a b. (a -> b) -> a -> b $ String "Operation completed in " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> String show (UTCTime -> UTCTime -> NominalDiffTime DTC.diffUTCTime UTCTime -end UTCTime -start) - forall (m :: * -> *) a. Monad m => a -> m a +end UTCTime +start) + forall (m :: * -> *) a. Monad m => a -> m a return a -a - where goM :: m a - goM :: m a -goM = forall (m :: * -> *) a. +a + where goM :: m a + goM :: m a +goM = forall (m :: * -> *) a. MonadAssertion m => m a -> (Failure -> m a) -> m a H.catchAssertion m a -f forall a b. (a -> b) -> a -> b -$ \Failure -e -> do - UTCTime -currentTime <- forall (m :: * -> *) a. MonadIO m => IO a -> m a +f forall a b. (a -> b) -> a -> b +$ \Failure +e -> do + UTCTime +currentTime <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO UTCTime DTC.getCurrentTime - if UTCTime -currentTime forall a. Ord a => a -> a -> Bool + if UTCTime +currentTime forall a. Ord a => a -> a -> Bool < UTCTime -deadline - then do - forall (m :: * -> *) a. MonadIO m => IO a -> m a +deadline + then do + forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Int -> IO () IO.threadDelay (forall a b. (RealFrac a, Integral b) => a -> b floor (NominalDiffTime -> Pico DTC.nominalDiffTimeToSeconds NominalDiffTime -period forall a. Num a => a -> a -> a +period forall a. Num a => a -> a -> a * Pico 1000000)) - m a -goM - else do - forall (m :: * -> *) a. + m a +goM + else do + forall (m :: * -> *) a. (MonadTest m, Show a, HasCallStack) => a -> m () H.annotateShow UTCTime -currentTime - forall (f :: * -> *) a. Functor f => f a -> f () +currentTime + forall (f :: * -> *) a. Functor f => f a -> f () void forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a failMessage HasCallStack => CallStack @@ -1382,396 +1423,396 @@ $ String "Condition not met by deadline: " forall a. Semigroup a => a -> a -> a <> String -errorMessage - forall (m :: * -> *) a. MonadAssertion m => Failure -> m a +errorMessage + forall (m :: * -> *) a. MonadAssertion m => Failure -> m a H.throwAssertion Failure -e - --- | Run the operation 'f' once a second until it returns 'True' or the duration expires. --- --- Expiration of the duration results in an assertion failure -byDurationIO :: (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> NominalDiffTime -> String -> IO a -> m a -byDurationIO :: forall (m :: * -> *) a. +e + +-- | Run the operation 'f' once a second until it returns 'True' or the duration expires. +-- +-- Expiration of the duration results in an assertion failure +byDurationIO :: (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> NominalDiffTime -> String -> IO a -> m a +byDurationIO :: forall (m :: * -> *) a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> NominalDiffTime -> String -> IO a -> m a -byDurationIO NominalDiffTime -period NominalDiffTime -duration String -errorMessage IO a -f = forall a. HasCallStack => (HasCallStack => a) -> a +byDurationIO NominalDiffTime +period NominalDiffTime +duration String +errorMessage IO a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> NominalDiffTime -> String -> m a -> m a byDurationM NominalDiffTime -period NominalDiffTime -duration String -errorMessage forall a b. (a -> b) -> a -> b +period NominalDiffTime +duration String +errorMessage forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO a -f - --- | 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 :: (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> NominalDiffTime -> String -> m a -> m a -byDurationM :: forall (m :: * -> *) a. +f + +-- | 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 :: (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> NominalDiffTime -> String -> m a -> m a +byDurationM :: forall (m :: * -> *) a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> NominalDiffTime -> String -> m a -> m a -byDurationM NominalDiffTime -period NominalDiffTime -duration String -errorMessage m a -f = forall a. HasCallStack => (HasCallStack => a) -> a +byDurationM NominalDiffTime +period NominalDiffTime +duration String +errorMessage m a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - UTCTime -deadline <- NominalDiffTime -> UTCTime -> UTCTime + UTCTime +deadline <- NominalDiffTime -> UTCTime -> UTCTime DTC.addUTCTime NominalDiffTime -duration forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +duration forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO UTCTime DTC.getCurrentTime - forall (m :: * -> *) a. + forall (m :: * -> *) a. (MonadAssertion m, MonadTest m, MonadIO m, HasCallStack) => NominalDiffTime -> UTCTime -> String -> m a -> m a byDeadlineM NominalDiffTime -period UTCTime -deadline String -errorMessage m a -f - --- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. --- --- Expiration of the deadline results in an assertion failure -assertByDeadlineIO :: (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> IO Bool -> m () -assertByDeadlineIO :: forall (m :: * -> *). +period UTCTime +deadline String +errorMessage m a +f + +-- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. +-- +-- Expiration of the deadline results in an assertion failure +assertByDeadlineIO :: (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> IO Bool -> m () +assertByDeadlineIO :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> IO Bool -> m () -assertByDeadlineIO UTCTime -deadline IO Bool -f = forall a. HasCallStack => (HasCallStack => a) -> a +assertByDeadlineIO UTCTime +deadline IO Bool +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Bool -success <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + Bool +success <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO Bool -f - forall (f :: * -> *). Applicative f => Bool -> f () -> f () +f + forall (f :: * -> *). Applicative f => Bool -> f () -> f () unless Bool -success forall a b. (a -> b) -> a -> b +success forall a b. (a -> b) -> a -> b $ do - UTCTime -currentTime <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + UTCTime +currentTime <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO UTCTime DTC.getCurrentTime - if UTCTime -currentTime forall a. Ord a => a -> a -> Bool + if UTCTime +currentTime forall a. Ord a => a -> a -> Bool < UTCTime -deadline - then do - forall (m :: * -> *) a. MonadIO m => IO a -> m a +deadline + then do + forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Int -> IO () IO.threadDelay Int 1000000 - forall (m :: * -> *). + forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> IO Bool -> m () assertByDeadlineIO UTCTime -deadline IO Bool -f - else do - forall (m :: * -> *) a. +deadline IO Bool +f + else do + forall (m :: * -> *) a. (MonadTest m, Show a, HasCallStack) => a -> m () H.annotateShow UTCTime -currentTime - forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a +currentTime + forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a failMessage HasCallStack => CallStack GHC.callStack String "Condition not met by deadline" - --- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. --- --- Expiration of the deadline results in an assertion failure -assertByDeadlineM :: (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> m Bool -> m () -assertByDeadlineM :: forall (m :: * -> *). + +-- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. +-- +-- Expiration of the deadline results in an assertion failure +assertByDeadlineM :: (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> m Bool -> m () +assertByDeadlineM :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> m Bool -> m () -assertByDeadlineM UTCTime -deadline m Bool -f = forall a. HasCallStack => (HasCallStack => a) -> a +assertByDeadlineM UTCTime +deadline m Bool +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Bool -success <- m Bool -f - forall (f :: * -> *). Applicative f => Bool -> f () -> f () + Bool +success <- m Bool +f + forall (f :: * -> *). Applicative f => Bool -> f () -> f () unless Bool -success forall a b. (a -> b) -> a -> b +success forall a b. (a -> b) -> a -> b $ do - UTCTime -currentTime <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + UTCTime +currentTime <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO UTCTime DTC.getCurrentTime - if UTCTime -currentTime forall a. Ord a => a -> a -> Bool + if UTCTime +currentTime forall a. Ord a => a -> a -> Bool < UTCTime -deadline - then do - forall (m :: * -> *) a. MonadIO m => IO a -> m a +deadline + then do + forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Int -> IO () IO.threadDelay Int 1000000 - forall (m :: * -> *). + forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> m Bool -> m () assertByDeadlineM UTCTime -deadline m Bool -f - else do - forall (m :: * -> *) a. +deadline m Bool +f + else do + forall (m :: * -> *) a. (MonadTest m, Show a, HasCallStack) => a -> m () H.annotateShow UTCTime -currentTime - forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a +currentTime + forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a failMessage HasCallStack => CallStack GHC.callStack String "Condition not met by deadline" - --- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. --- --- The action 'g' is run after expiration of the deadline, but before failure allowing for --- additional annotations to be presented. --- --- Expiration of the deadline results in an assertion failure -assertByDeadlineIOFinally :: (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> IO Bool -> m () -> m () -assertByDeadlineIOFinally :: forall (m :: * -> *). + +-- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. +-- +-- The action 'g' is run after expiration of the deadline, but before failure allowing for +-- additional annotations to be presented. +-- +-- Expiration of the deadline results in an assertion failure +assertByDeadlineIOFinally :: (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> IO Bool -> m () -> m () +assertByDeadlineIOFinally :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> IO Bool -> m () -> m () -assertByDeadlineIOFinally UTCTime -deadline IO Bool -f m () -g = forall a. HasCallStack => (HasCallStack => a) -> a +assertByDeadlineIOFinally UTCTime +deadline IO Bool +f m () +g = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Bool -success <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + Bool +success <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO Bool -f - forall (f :: * -> *). Applicative f => Bool -> f () -> f () +f + forall (f :: * -> *). Applicative f => Bool -> f () -> f () unless Bool -success forall a b. (a -> b) -> a -> b +success forall a b. (a -> b) -> a -> b $ do - UTCTime -currentTime <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + UTCTime +currentTime <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO UTCTime DTC.getCurrentTime - if UTCTime -currentTime forall a. Ord a => a -> a -> Bool + if UTCTime +currentTime forall a. Ord a => a -> a -> Bool < UTCTime -deadline - then do - forall (m :: * -> *) a. MonadIO m => IO a -> m a +deadline + then do + forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Int -> IO () IO.threadDelay Int 1000000 - forall (m :: * -> *). + forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> IO Bool -> m () -> m () assertByDeadlineIOFinally UTCTime -deadline IO Bool -f m () -g - else do - forall (m :: * -> *) a. +deadline IO Bool +f m () +g + else do + forall (m :: * -> *) a. (MonadTest m, Show a, HasCallStack) => a -> m () H.annotateShow UTCTime -currentTime - m () -g - forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a +currentTime + m () +g + forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a failMessage HasCallStack => CallStack GHC.callStack String "Condition not met by deadline" - --- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. --- --- The action 'g' is run after expiration of the deadline, but before failure allowing for --- additional annotations to be presented. --- --- Expiration of the deadline results in an assertion failure -assertByDeadlineMFinally :: (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> m Bool -> m () -> m () -assertByDeadlineMFinally :: forall (m :: * -> *). + +-- | Run the operation 'f' once a second until it returns 'True' or the deadline expires. +-- +-- The action 'g' is run after expiration of the deadline, but before failure allowing for +-- additional annotations to be presented. +-- +-- Expiration of the deadline results in an assertion failure +assertByDeadlineMFinally :: (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> m Bool -> m () -> m () +assertByDeadlineMFinally :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> m Bool -> m () -> m () -assertByDeadlineMFinally UTCTime -deadline m Bool -f m () -g = forall a. HasCallStack => (HasCallStack => a) -> a +assertByDeadlineMFinally UTCTime +deadline m Bool +f m () +g = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Bool -success <- m Bool -f - forall (f :: * -> *). Applicative f => Bool -> f () -> f () + Bool +success <- m Bool +f + forall (f :: * -> *). Applicative f => Bool -> f () -> f () unless Bool -success forall a b. (a -> b) -> a -> b +success forall a b. (a -> b) -> a -> b $ do - UTCTime -currentTime <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + UTCTime +currentTime <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO IO UTCTime DTC.getCurrentTime - if UTCTime -currentTime forall a. Ord a => a -> a -> Bool + if UTCTime +currentTime forall a. Ord a => a -> a -> Bool < UTCTime -deadline - then do - forall (m :: * -> *) a. MonadIO m => IO a -> m a +deadline + then do + forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Int -> IO () IO.threadDelay Int 1000000 - forall (m :: * -> *). + forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => UTCTime -> m Bool -> m () -> m () assertByDeadlineMFinally UTCTime -deadline m Bool -f m () -g - else do - forall (m :: * -> *) a. +deadline m Bool +f m () +g + else do + forall (m :: * -> *) a. (MonadTest m, Show a, HasCallStack) => a -> m () H.annotateShow UTCTime -currentTime - m () -g - forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a +currentTime + m () +g + forall (m :: * -> *) a. MonadTest m => CallStack -> String -> m a failMessage HasCallStack => CallStack GHC.callStack String "Condition not met by deadline" - --- | Run the test function against the value. Report the value on the failure. -assertWith :: (H.MonadTest m, Show p, HasCallStack) => p -> (p -> Bool) -> m () -assertWith :: forall (m :: * -> *) p. + +-- | Run the test function against the value. Report the value on the failure. +assertWith :: (H.MonadTest m, Show p, HasCallStack) => p -> (p -> Bool) -> m () +assertWith :: forall (m :: * -> *) p. (MonadTest m, Show p, HasCallStack) => p -> (p -> Bool) -> m () -assertWith p -v p -> Bool -f = forall a. HasCallStack => (HasCallStack => a) -> a +assertWith p +v p -> Bool +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) p. (MonadTest m, Show p, HasCallStack) => p -> (p -> m Bool) -> m () assertWithM p -v (forall (f :: * -> *) a. Applicative f => a -> f a +v (forall (f :: * -> *) a. Applicative f => a -> f a pure forall b c a. (b -> c) -> (a -> b) -> a -> c . p -> Bool -f) - --- | Run the test function against the value. Report the value on the failure. -assertWithM :: (H.MonadTest m, Show p, HasCallStack) => p -> (p -> m Bool) -> m () -assertWithM :: forall (m :: * -> *) p. +f) + +-- | Run the test function against the value. Report the value on the failure. +assertWithM :: (H.MonadTest m, Show p, HasCallStack) => p -> (p -> m Bool) -> m () +assertWithM :: forall (m :: * -> *) p. (MonadTest m, Show p, HasCallStack) => p -> (p -> m Bool) -> m () -assertWithM p -v p -> m Bool -f = forall a. HasCallStack => (HasCallStack => a) -> a +assertWithM p +v p -> m Bool +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Bool -result <- p -> m Bool -f p -v - if Bool -result - then forall (m :: * -> *). MonadTest m => m () + Bool +result <- p -> m Bool +f p +v + if Bool +result + then forall (m :: * -> *). MonadTest m => m () H.success - else do - forall (m :: * -> *) a. + else do + forall (m :: * -> *) a. (MonadTest m, HasCallStack, Show a) => a -> m () noteShow_ p -v - forall (m :: * -> *). (MonadTest m, HasCallStack) => Bool -> m () +v + forall (m :: * -> *). (MonadTest m, HasCallStack) => Bool -> m () H.assert Bool -result - --- | Run the monadic action 'f' and assert the return value is 'True'. -assertM :: (MonadTest m, HasCallStack) => m Bool -> m () -assertM :: forall (m :: * -> *). (MonadTest m, HasCallStack) => m Bool -> m () -assertM m Bool -f = forall a. HasCallStack => (HasCallStack => a) -> a +result + +-- | Run the monadic action 'f' and assert the return value is 'True'. +assertM :: (MonadTest m, HasCallStack) => m Bool -> m () +assertM :: forall (m :: * -> *). (MonadTest m, HasCallStack) => m Bool -> m () +assertM m Bool +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ m Bool -f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall (m :: * -> *). (MonadTest m, HasCallStack) => Bool -> m () H.assert - --- | Run the IO action 'f' and assert the return value is 'True'. -assertIO :: (MonadTest m, MonadIO m, HasCallStack) => IO Bool -> m () -assertIO :: forall (m :: * -> *). + +-- | Run the IO action 'f' and assert the return value is 'True'. +assertIO :: (MonadTest m, MonadIO m, HasCallStack) => IO Bool -> m () +assertIO :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => IO Bool -> m () -assertIO IO Bool -f = forall a. HasCallStack => (HasCallStack => a) -> a +assertIO IO Bool +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO (forall (m :: * -> *) a. (Monad m, NFData a) => m a -> m a forceM IO Bool -f) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +f) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall (m :: * -> *). (MonadTest m, HasCallStack) => Bool -> m () H.assert - --- | Tests if @|c - v| <= r@ -assertWithinTolerance :: (Show a, Ord a, Num a, HasCallStack, H.MonadTest m) - => a -- ^ tested value @v@ - -> a -- ^ expected value @c@ - -> a -- ^ tolerance range @r@ - -> m () -assertWithinTolerance :: forall a (m :: * -> *). + +-- | Tests if @|c - v| <= r@ +assertWithinTolerance :: (Show a, Ord a, Num a, HasCallStack, H.MonadTest m) + => a -- ^ tested value @v@ + -> a -- ^ expected value @c@ + -> a -- ^ tolerance range @r@ + -> m () +assertWithinTolerance :: forall a (m :: * -> *). (Show a, Ord a, Num a, HasCallStack, MonadTest m) => a -> a -> a -> m () -assertWithinTolerance a -v a -c a -r = forall a. HasCallStack => (HasCallStack => a) -> a +assertWithinTolerance a +v a +c a +r = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - forall (m :: * -> *) a b. + forall (m :: * -> *) a b. (MonadTest m, Show a, Show b, HasCallStack) => a -> (a -> b -> Bool) -> b -> m () H.diff a -v forall a. Ord a => a -> a -> Bool +v forall a. Ord a => a -> a -> Bool (>=) (a -c forall a. Num a => a -> a -> a +c forall a. Num a => a -> a -> a - a -r) - forall (m :: * -> *) a b. +r) + forall (m :: * -> *) a b. (MonadTest m, Show a, Show b, HasCallStack) => a -> (a -> b -> Bool) -> b -> m () H.diff a -v forall a. Ord a => a -> a -> Bool +v forall a. Ord a => a -> a -> Bool (<=) (a -c forall a. Num a => a -> a -> a +c forall a. Num a => a -> a -> a + a -r) - --- | Release the given release key. -release :: (MonadTest m, MonadIO m) => ReleaseKey -> m () -release :: forall (m :: * -> *). +r) + +-- | Release the given release key. +release :: (MonadTest m, MonadIO m) => ReleaseKey -> m () +release :: forall (m :: * -> *). (MonadTest m, MonadIO m) => ReleaseKey -> m () -release ReleaseKey -k = forall a. HasCallStack => (HasCallStack => a) -> a +release ReleaseKey +k = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => @@ -1779,175 +1820,175 @@ H.evalIO forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadIO m => ReleaseKey -> m () IO.release ReleaseKey -k - -onFailure :: Integration () -> Integration () -onFailure :: Integration () -> Integration () -onFailure Integration () -f = do - IntegrationState -s <- forall r (m :: * -> *). MonadReader r m => m r +k + +onFailure :: Integration () -> Integration () +onFailure :: Integration () -> Integration () +onFailure Integration () +f = do + IntegrationState +s <- forall r (m :: * -> *). MonadReader r m => m r ask - forall (m :: * -> *) a. MonadIO m => IO a -> m a + forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. STM a -> IO a STM.atomically forall a b. (a -> b) -> a -> b $ forall a. TVar a -> (a -> a) -> STM () STM.modifyTVar (IntegrationState -> TVar [Integration ()] integrationStateFinals IntegrationState -s) (Integration () -fforall a. a -> [a] -> [a] +s) (Integration () +fforall a. a -> [a] -> [a] :) - -reportFinally :: Integration () -> Integration () -reportFinally :: Integration () -> Integration () -reportFinally Integration () -f = do - Either Failure () -result <- forall (m :: * -> *) a. + +reportFinally :: Integration () -> Integration () +reportFinally :: Integration () -> Integration () +reportFinally Integration () +f = do + Either Failure () +result <- forall (m :: * -> *) a. MonadAssertion m => m a -> (Failure -> m a) -> m a H.catchAssertion (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap forall a b. b -> Either a b Right Integration () -f) (forall (m :: * -> *) a. Monad m => a -> m a +f) (forall (m :: * -> *) a. Monad m => a -> m a return forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a b. a -> Either a b Left) - - case Either Failure () -result of - Right () -> forall (m :: * -> *) a. Monad m => a -> m a + + case Either Failure () +result of + Right () -> forall (m :: * -> *) a. Monad m => a -> m a return () - Left Failure -a -> forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () + Left Failure +a -> forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () note_ forall a b. (a -> b) -> a -> b $ String "Unable to run finally: " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> String show Failure -a - -runFinallies :: Integration a -> Integration a -runFinallies :: forall a. Integration a -> Integration a -runFinallies Integration a -f = do - Either Failure a -result <- forall (m :: * -> *) a. +a + +runFinallies :: Integration a -> Integration a +runFinallies :: forall a. Integration a -> Integration a +runFinallies Integration a +f = do + Either Failure a +result <- forall (m :: * -> *) a. MonadAssertion m => m a -> (Failure -> m a) -> m a H.catchAssertion (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap forall a b. b -> Either a b Right Integration a -f) (forall (m :: * -> *) a. Monad m => a -> m a +f) (forall (m :: * -> *) a. Monad m => a -> m a return forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a b. a -> Either a b Left) - - case Either Failure a -result of - Right a -a -> forall (m :: * -> *) a. Monad m => a -> m a + + case Either Failure a +result of + Right a +a -> forall (m :: * -> *) a. Monad m => a -> m a return a -a - Left Failure -assertion -> do - IntegrationState -s <- forall r (m :: * -> *). MonadReader r m => m r +a + Left Failure +assertion -> do + IntegrationState +s <- forall r (m :: * -> *). MonadReader r m => m r ask - [Integration ()] -finals <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + [Integration ()] +finals <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. STM a -> IO a STM.atomically forall a b. (a -> b) -> a -> b $ forall a. TVar a -> a -> STM a STM.swapTVar (IntegrationState -> TVar [Integration ()] integrationStateFinals IntegrationState -s) [] - forall (t :: * -> *) (m :: * -> *) a b. +s) [] + forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => (a -> m b) -> t a -> m () mapM_ Integration () -> Integration () reportFinally [Integration ()] -finals - forall (m :: * -> *) a. MonadAssertion m => Failure -> m a +finals + forall (m :: * -> *) a. MonadAssertion m => Failure -> m a H.throwAssertion Failure -assertion - -retry :: forall a. Int -> (Int -> Integration a) -> Integration a -retry :: forall a. Int -> (Int -> Integration a) -> Integration a -retry Int -n Int -> Integration a -f = Int -> Integration a -go Int +assertion + +retry :: forall a. Int -> (Int -> Integration a) -> Integration a +retry :: forall a. Int -> (Int -> Integration a) -> Integration a +retry Int +n Int -> Integration a +f = Int -> Integration a +go Int 0 - where go :: Int -> Integration a - go :: Int -> Integration a -go Int -i = do - forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () + where go :: Int -> Integration a + go :: Int -> Integration a +go Int +i = do + forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () note_ forall a b. (a -> b) -> a -> b $ String "Retry attempt " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> String show Int -i forall a. Semigroup a => a -> a -> a +i forall a. Semigroup a => a -> a -> a <> String " of " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> String show Int -n - Either Failure a -result <- forall (m :: * -> *) a. +n + Either Failure a +result <- forall (m :: * -> *) a. MonadAssertion m => m a -> (Failure -> m a) -> m a H.catchAssertion (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap forall a b. b -> Either a b Right (Int -> Integration a -f Int -i)) (forall (m :: * -> *) a. Monad m => a -> m a +f Int +i)) (forall (m :: * -> *) a. Monad m => a -> m a return forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a b. a -> Either a b Left) - - case Either Failure a -result of - Right a -a -> forall (m :: * -> *) a. Monad m => a -> m a + + case Either Failure a +result of + Right a +a -> forall (m :: * -> *) a. Monad m => a -> m a return a -a - Left Failure -assertion -> do - if Int -i forall a. Ord a => a -> a -> Bool +a + Left Failure +assertion -> do + if Int +i forall a. Ord a => a -> a -> Bool < Int -n - then Int -> Integration a -go (Int -i forall a. Num a => a -> a -> a +n + then Int -> Integration a +go (Int +i forall a. Num a => a -> a -> a + Int 1) - else do - forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () + else do + forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () note_ forall a b. (a -> b) -> a -> b $ String "All " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> String show Int -n forall a. Semigroup a => a -> a -> a +n forall a. Semigroup a => a -> a -> a <> String " attempts failed" - forall (m :: * -> *) a. MonadAssertion m => Failure -> m a + forall (m :: * -> *) a. MonadAssertion m => Failure -> m a H.throwAssertion Failure -assertion - -retry' :: forall a. Int -> Integration a -> Integration a -retry' :: forall a. Int -> Integration a -> Integration a -retry' Int -n Integration a -f = forall a. Int -> (Int -> Integration a) -> Integration a +assertion + +retry' :: forall a. Int -> Integration a -> Integration a +retry' :: forall a. Int -> Integration a -> Integration a +retry' Int +n Integration a +f = forall a. Int -> (Int -> Integration a) -> Integration a retry Int -n (forall a b. a -> b -> a +n (forall a b. a -> b -> a const Integration a -f) - \ No newline at end of file +f) + \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Test.Concurrent.html b/hedgehog-extras/src/Hedgehog.Extras.Test.Concurrent.html index 7deb3455..124ccd8e 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Test.Concurrent.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Test.Concurrent.html @@ -95,12 +95,12 @@ import qualified Hedgehog as H -- | Delay the thread by 'n' milliseconds. -threadDelay :: (HasCallStack, MonadTest m, MonadIO m) => Int -> m () +threadDelay :: (HasCallStack, MonadTest m, MonadIO m) => Int -> m () threadDelay :: forall (m :: * -> *). (HasCallStack, MonadTest m, MonadIO m) => Int -> m () -threadDelay Int -n = forall a. HasCallStack => (HasCallStack => a) -> a +threadDelay Int +n = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => @@ -108,20 +108,20 @@ H.evalIO forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadBase IO m => Int -> m () IO.threadDelay Int -n +n -- | Runs an action in background, and registers its cancellation to 'MonadResource'. -asyncRegister_ :: HasCallStack - => MonadTest m - => MonadResource m - => MonadCatch m - => IO a -- ^ Action to run in background - -> m () +asyncRegister_ :: HasCallStack + => MonadTest m + => MonadResource m + => MonadCatch m + => IO a -- ^ Action to run in background + -> m () asyncRegister_ :: forall (m :: * -> *) a. (HasCallStack, MonadTest m, MonadResource m, MonadCatch m) => IO a -> m () -asyncRegister_ IO a -act = forall a. HasCallStack => (HasCallStack => a) -> a +asyncRegister_ IO a +act = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (f :: * -> *) a. Functor f => f a -> f () void forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -136,33 +136,33 @@ MonadBaseControl IO m => m a -> m (Async (StM m a)) async IO a -act) forall a. Async a -> IO () -cleanUp +act) forall a. Async a -> IO () +cleanUp where - cleanUp :: Async a -> IO () - cleanUp :: forall a. Async a -> IO () -cleanUp Async a -a = forall (m :: * -> *) a. MonadBase IO m => Async a -> m () + cleanUp :: Async a -> IO () + cleanUp :: forall a. Async a -> IO () +cleanUp Async a +a = forall (m :: * -> *) a. MonadBase IO m => Async a -> m () cancel Async a -a forall (m :: * -> *) a b. Monad m => m a -> m b -> m b +a forall (m :: * -> *) a b. Monad m => m a -> m b -> m b >> forall (f :: * -> *) a. Functor f => f a -> f () void (forall (m :: * -> *) a. MonadBase IO m => Async a -> m () link Async a -a) +a) instance MonadBase IO (ResourceT IO) where - liftBase :: forall α. IO α -> ResourceT IO α + liftBase :: forall α. IO α -> ResourceT IO α liftBase = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO instance MonadBaseControl IO (ResourceT IO) where - type StM (ResourceT IO) a = a - liftBaseWith :: forall a. (RunInBase (ResourceT IO) IO -> IO a) -> ResourceT IO a + type StM (ResourceT IO) a = a + liftBaseWith :: forall a. (RunInBase (ResourceT IO) IO -> IO a) -> ResourceT IO a liftBaseWith = forall (m :: * -> *) b. MonadUnliftIO m => ((forall a. m a -> IO a) -> IO b) -> m b UnliftIO.withRunInIO - restoreM :: forall a. StM (ResourceT IO) a -> ResourceT IO a + restoreM :: forall a. StM (ResourceT IO) a -> ResourceT IO a restoreM = forall (f :: * -> *) a. Applicative f => a -> f a pure \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Test.File.html b/hedgehog-extras/src/Hedgehog.Extras.Test.File.html index 1a788a54..cef7a4db 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Test.File.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Test.File.html @@ -87,12 +87,12 @@ import qualified System.IO as IO -- | Create the 'directory' directory if it is missing. -createDirectoryIfMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m FilePath +createDirectoryIfMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m FilePath createDirectoryIfMissing :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m FilePath -createDirectoryIfMissing FilePath -directory = forall a. HasCallStack => (HasCallStack => a) -> a +createDirectoryIfMissing FilePath +directory = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). @@ -102,7 +102,7 @@ $ FilePath "Creating directory if missing: " forall a. Semigroup a => a -> a -> a <> FilePath -directory +directory forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a @@ -110,18 +110,18 @@ $ Bool -> FilePath -> IO () IO.createDirectoryIfMissing Bool True FilePath -directory +directory forall (f :: * -> *) a. Applicative f => a -> f a pure FilePath -directory +directory -- | Create the 'directory' directory if it is missing. -createDirectoryIfMissing_ :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () +createDirectoryIfMissing_ :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () createDirectoryIfMissing_ :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () -createDirectoryIfMissing_ FilePath -directory = forall a. HasCallStack => (HasCallStack => a) -> a +createDirectoryIfMissing_ FilePath +directory = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (f :: * -> *) a. Functor f => f a -> f () @@ -130,22 +130,22 @@ (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m FilePath createDirectoryIfMissing FilePath -directory +directory -- | Create the 'subdirectory' subdirectory if it is missing. The subdirectory is returned. -createSubdirectoryIfMissing :: () +createSubdirectoryIfMissing :: () => HasCallStack - => MonadTest m - => MonadIO m + => MonadTest m + => MonadIO m => FilePath -> FilePath - -> m FilePath + -> m FilePath createSubdirectoryIfMissing :: forall (m :: * -> *). (HasCallStack, MonadTest m, MonadIO m) => FilePath -> FilePath -> m FilePath -createSubdirectoryIfMissing FilePath -parent FilePath -subdirectory = forall a. HasCallStack => (HasCallStack => a) -> a +createSubdirectoryIfMissing FilePath +parent FilePath +subdirectory = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). @@ -155,7 +155,7 @@ $ FilePath "Creating subdirectory if missing: " forall a. Semigroup a => a -> a -> a <> FilePath -subdirectory +subdirectory forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a @@ -164,27 +164,27 @@ IO.createDirectoryIfMissing Bool True forall a b. (a -> b) -> a -> b $ FilePath -parent FilePath -> FilePath -> FilePath +parent FilePath -> FilePath -> FilePath </> FilePath -subdirectory +subdirectory forall (f :: * -> *) a. Applicative f => a -> f a pure FilePath -subdirectory +subdirectory -- | Create the 'subdirectory' subdirectory if it is missing. The subdirectory is returned. -createSubdirectoryIfMissing_ :: () +createSubdirectoryIfMissing_ :: () => HasCallStack - => MonadTest m - => MonadIO m + => MonadTest m + => MonadIO m => FilePath -> FilePath - -> m () + -> m () createSubdirectoryIfMissing_ :: forall (m :: * -> *). (HasCallStack, MonadTest m, MonadIO m) => FilePath -> FilePath -> m () -createSubdirectoryIfMissing_ FilePath -parent FilePath -subdirectory = forall a. HasCallStack => (HasCallStack => a) -> a +createSubdirectoryIfMissing_ FilePath +parent FilePath +subdirectory = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (f :: * -> *) a. Functor f => f a -> f () @@ -193,17 +193,17 @@ (HasCallStack, MonadTest m, MonadIO m) => FilePath -> FilePath -> m FilePath createSubdirectoryIfMissing FilePath -parent FilePath -subdirectory +parent FilePath +subdirectory -- | Copy the contents of the 'src' file to the 'dst' file. -copyFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () +copyFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () copyFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () -copyFile FilePath -src FilePath -dst = forall a. HasCallStack => (HasCallStack => a) -> a +copyFile FilePath +src FilePath +dst = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). @@ -214,29 +214,29 @@ "Copying from " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> FilePath show FilePath -src forall a. Semigroup a => a -> a -> a +src forall a. Semigroup a => a -> a -> a <> FilePath " to " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> FilePath show FilePath -dst +dst forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> FilePath -> IO () IO.copyFile FilePath -src FilePath -dst +src FilePath +dst -- | Rename the 'src' file to 'dst'. -renameFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () +renameFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () renameFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () -renameFile FilePath -src FilePath -dst = forall a. HasCallStack => (HasCallStack => a) -> a +renameFile FilePath +src FilePath +dst = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). @@ -247,29 +247,29 @@ "Renaming from " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> FilePath show FilePath -src forall a. Semigroup a => a -> a -> a +src forall a. Semigroup a => a -> a -> a <> FilePath " to " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> FilePath show FilePath -dst +dst forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> FilePath -> IO () IO.renameFile FilePath -src FilePath -dst +src FilePath +dst -- | Create a symbolic link from 'dst' to 'src'. -createFileLink :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () +createFileLink :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () createFileLink :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () -createFileLink FilePath -src FilePath -dst = forall a. HasCallStack => (HasCallStack => a) -> a +createFileLink FilePath +src FilePath +dst = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). @@ -280,12 +280,12 @@ "Creating link from " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> FilePath show FilePath -dst forall a. Semigroup a => a -> a -> a +dst forall a. Semigroup a => a -> a -> a <> FilePath " to " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> FilePath show FilePath -src +src if Bool isWin32 then forall (m :: * -> *) a. @@ -294,24 +294,24 @@ H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> FilePath -> IO () IO.copyFile FilePath -src FilePath -dst +src FilePath +dst else forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> FilePath -> IO () IO.createFileLink FilePath -src FilePath -dst +src FilePath +dst -- | List 'p' directory. -listDirectory :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m [FilePath] +listDirectory :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m [FilePath] listDirectory :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m [FilePath] -listDirectory FilePath -p = forall a. HasCallStack => (HasCallStack => a) -> a +listDirectory FilePath +p = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -323,23 +323,23 @@ $ FilePath "Listing directory: " forall a. Semigroup a => a -> a -> a <> FilePath -p +p forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> IO [FilePath] IO.listDirectory FilePath -p +p -- | Append 'contents' to the 'filePath' file. -appendFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> m () +appendFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> m () appendFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () -appendFile FilePath -filePath FilePath -contents = forall a. HasCallStack => (HasCallStack => a) -> a +appendFile FilePath +filePath FilePath +contents = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -351,24 +351,24 @@ $ FilePath "Writing file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> FilePath -> IO () IO.appendFile FilePath -filePath FilePath -contents +filePath FilePath +contents -- | Write 'contents' to the 'filePath' file. -writeFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> m () +writeFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> m () writeFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () -writeFile FilePath -filePath FilePath -contents = forall a. HasCallStack => (HasCallStack => a) -> a +writeFile FilePath +filePath FilePath +contents = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -380,24 +380,24 @@ $ FilePath "Writing file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> FilePath -> IO () IO.writeFile FilePath -filePath FilePath -contents +filePath FilePath +contents -- | Open a handle to the 'filePath' file. -openFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> IOMode -> m Handle +openFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> IOMode -> m Handle openFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> IOMode -> m Handle -openFile FilePath -filePath IOMode -mode = forall a. HasCallStack => (HasCallStack => a) -> a +openFile FilePath +filePath IOMode +mode = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -409,23 +409,23 @@ $ FilePath "Opening file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> IOMode -> IO Handle IO.openFile FilePath -filePath IOMode -mode +filePath IOMode +mode -- | Read the contents of the 'filePath' file. -readFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m String +readFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m String readFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m FilePath -readFile FilePath -filePath = forall a. HasCallStack => (HasCallStack => a) -> a +readFile FilePath +filePath = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -437,23 +437,23 @@ $ FilePath "Reading file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> IO FilePath IO.readFile FilePath -filePath +filePath -- | Write 'contents' to the 'filePath' file. -lbsWriteFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> LBS.ByteString -> m () +lbsWriteFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> LBS.ByteString -> m () lbsWriteFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> ByteString -> m () -lbsWriteFile FilePath -filePath ByteString -contents = forall a. HasCallStack => (HasCallStack => a) -> a +lbsWriteFile FilePath +filePath ByteString +contents = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -465,23 +465,23 @@ $ FilePath "Writing file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> ByteString -> IO () LBS.writeFile FilePath -filePath ByteString -contents +filePath ByteString +contents -- | Read the contents of the 'filePath' file. -lbsReadFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m LBS.ByteString +lbsReadFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m LBS.ByteString lbsReadFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ByteString -lbsReadFile FilePath -filePath = forall a. HasCallStack => (HasCallStack => a) -> a +lbsReadFile FilePath +filePath = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -493,23 +493,23 @@ $ FilePath "Reading file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> IO ByteString LBS.readFile FilePath -filePath +filePath -- | Write 'contents' to the 'filePath' file. -textWriteFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> Text -> m () +textWriteFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> Text -> m () textWriteFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> Text -> m () -textWriteFile FilePath -filePath Text -contents = forall a. HasCallStack => (HasCallStack => a) -> a +textWriteFile FilePath +filePath Text +contents = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -521,23 +521,23 @@ $ FilePath "Writing file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> Text -> IO () T.writeFile FilePath -filePath Text -contents +filePath Text +contents -- | Read the contents of the 'filePath' file. -textReadFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m Text +textReadFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m Text textReadFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m Text -textReadFile FilePath -filePath = forall a. HasCallStack => (HasCallStack => a) -> a +textReadFile FilePath +filePath = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -549,22 +549,22 @@ $ FilePath "Reading file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> IO Text T.readFile FilePath -filePath +filePath -- | Read the 'filePath' file as JSON. Use @readJsonFile \@'Value'@ to decode into 'Value'. -readJsonFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, HasCallStack) => FilePath -> m (Either String a) +readJsonFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, HasCallStack) => FilePath -> m (Either String a) readJsonFile :: forall a (m :: * -> *). (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m (Either FilePath a) -readJsonFile FilePath -filePath = forall a. HasCallStack => (HasCallStack => a) -> a +readJsonFile FilePath +filePath = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -576,7 +576,7 @@ $ FilePath "Reading JSON file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a @@ -585,16 +585,16 @@ J.eitherDecode forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> FilePath -> IO ByteString LBS.readFile FilePath -filePath +filePath -- | Read the 'filePath' file as JSON. Same as 'readJsonFile' but fails on error. Use -- @readJsonFileOk \@'Value'@ to decode into 'Value'. -readJsonFileOk :: forall a m.(MonadTest m, MonadIO m, Y.FromJSON a, HasCallStack) => FilePath -> m a +readJsonFileOk :: forall a m.(MonadTest m, MonadIO m, Y.FromJSON a, HasCallStack) => FilePath -> m a readJsonFileOk :: forall a (m :: * -> *). (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m a -readJsonFileOk FilePath -filePath = forall a. HasCallStack => (HasCallStack => a) -> a +readJsonFileOk FilePath +filePath = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) e a. @@ -605,40 +605,40 @@ (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m (Either FilePath a) readJsonFile FilePath -filePath +filePath -rewriteLbsJson :: forall a m. (MonadTest m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => (a -> a) -> LBS.ByteString -> m LBS.ByteString +rewriteLbsJson :: forall a m. (MonadTest m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => (a -> a) -> LBS.ByteString -> m LBS.ByteString rewriteLbsJson :: forall a (m :: * -> *). (MonadTest m, FromJSON a, ToJSON a, HasCallStack) => (a -> a) -> ByteString -> m ByteString -rewriteLbsJson a -> a -f ByteString -lbs = forall a. HasCallStack => (HasCallStack => a) -> a +rewriteLbsJson a -> a +f ByteString +lbs = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do case forall a. FromJSON a => ByteString -> Either FilePath a J.eitherDecode ByteString -lbs of - Right a -iv -> forall (m :: * -> *) a. Monad m => a -> m a +lbs of + Right a +iv -> forall (m :: * -> *) a. Monad m => a -> m a return (forall a. ToJSON a => a -> ByteString J.encode (a -> a -f a -iv)) - Left FilePath -msg -> forall (m :: * -> *) a. MonadTest m => CallStack -> FilePath -> m a +f a +iv)) + Left FilePath +msg -> forall (m :: * -> *) a. MonadTest m => CallStack -> FilePath -> m a H.failMessage HasCallStack => CallStack GHC.callStack FilePath -msg +msg -- | Rewrite the 'filePath' JSON file using the function 'f'. -rewriteJsonFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => FilePath -> (a -> a) -> m () +rewriteJsonFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => FilePath -> (a -> a) -> m () rewriteJsonFile :: forall a (m :: * -> *). (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> (a -> a) -> m () -rewriteJsonFile FilePath -filePath a -> a -f = forall a. HasCallStack => (HasCallStack => a) -> a +rewriteJsonFile FilePath +filePath a -> a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -650,32 +650,32 @@ $ FilePath "Rewriting JSON file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ByteString lbsReadFile FilePath -filePath forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +filePath forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall a (m :: * -> *). (MonadTest m, FromJSON a, ToJSON a, HasCallStack) => (a -> a) -> ByteString -> m ByteString rewriteLbsJson a -> a -f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> ByteString -> m () lbsWriteFile FilePath -filePath +filePath -- | Rewrite the 'filePath' JSON file using the function 'f'. -copyRewriteJsonFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => FilePath -> FilePath -> (a -> a) -> m () +copyRewriteJsonFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => FilePath -> FilePath -> (a -> a) -> m () copyRewriteJsonFile :: forall a (m :: * -> *). (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> FilePath -> (a -> a) -> m () -copyRewriteJsonFile FilePath -src FilePath -dst a -> a -f = forall a. HasCallStack => (HasCallStack => a) -> a +copyRewriteJsonFile FilePath +src FilePath +dst a -> a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -687,34 +687,34 @@ $ FilePath "Rewriting JSON from file: " forall a. Semigroup a => a -> a -> a <> FilePath -src forall a. Semigroup a => a -> a -> a +src forall a. Semigroup a => a -> a -> a <> FilePath " to file " forall a. Semigroup a => a -> a -> a <> FilePath -dst +dst forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ByteString lbsReadFile FilePath -src forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +src forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall a (m :: * -> *). (MonadTest m, FromJSON a, ToJSON a, HasCallStack) => (a -> a) -> ByteString -> m ByteString rewriteLbsJson a -> a -f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> ByteString -> m () lbsWriteFile FilePath -dst +dst -- | Read the 'filePath' file as YAML. -readYamlFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, HasCallStack) => FilePath -> m (Either Y.ParseException a) +readYamlFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, HasCallStack) => FilePath -> m (Either Y.ParseException a) readYamlFile :: forall a (m :: * -> *). (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m (Either ParseException a) -readYamlFile FilePath -filePath = forall a. HasCallStack => (HasCallStack => a) -> a +readYamlFile FilePath +filePath = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -726,7 +726,7 @@ $ FilePath "Reading YAML file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a @@ -737,15 +737,15 @@ LBS.toStrict forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> FilePath -> IO ByteString LBS.readFile FilePath -filePath +filePath -- | Read the 'filePath' file as YAML. Same as 'readYamlFile' but fails on error. -readYamlFileOk :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, HasCallStack) => FilePath -> m a +readYamlFileOk :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, HasCallStack) => FilePath -> m a readYamlFileOk :: forall a (m :: * -> *). (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m a -readYamlFileOk FilePath -filePath = forall a. HasCallStack => (HasCallStack => a) -> a +readYamlFileOk FilePath +filePath = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) e a. @@ -756,42 +756,42 @@ (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m (Either ParseException a) readYamlFile FilePath -filePath +filePath -rewriteLbsYaml :: forall a m. (MonadTest m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => (a -> a) -> LBS.ByteString -> m LBS.ByteString +rewriteLbsYaml :: forall a m. (MonadTest m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => (a -> a) -> LBS.ByteString -> m LBS.ByteString rewriteLbsYaml :: forall a (m :: * -> *). (MonadTest m, FromJSON a, ToJSON a, HasCallStack) => (a -> a) -> ByteString -> m ByteString -rewriteLbsYaml a -> a -f ByteString -lbs = forall a. HasCallStack => (HasCallStack => a) -> a +rewriteLbsYaml a -> a +f ByteString +lbs = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do case forall a. FromJSON a => ByteString -> Either ParseException a Y.decodeEither' (ByteString -> ByteString LBS.toStrict ByteString -lbs) of - Right a -iv -> forall (m :: * -> *) a. Monad m => a -> m a +lbs) of + Right a +iv -> forall (m :: * -> *) a. Monad m => a -> m a return (forall a. ToJSON a => a -> ByteString J.encode (a -> a -f a -iv)) - Left ParseException -msg -> forall (m :: * -> *) a. MonadTest m => CallStack -> FilePath -> m a +f a +iv)) + Left ParseException +msg -> forall (m :: * -> *) a. MonadTest m => CallStack -> FilePath -> m a H.failMessage HasCallStack => CallStack GHC.callStack (forall a. Show a => a -> FilePath show ParseException -msg) +msg) -- | Rewrite the 'filePath' YAML file using the function 'f'. -rewriteYamlFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => FilePath -> (a -> a) -> m () +rewriteYamlFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => FilePath -> (a -> a) -> m () rewriteYamlFile :: forall a (m :: * -> *). (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> (a -> a) -> m () -rewriteYamlFile FilePath -filePath a -> a -f = forall a. HasCallStack => (HasCallStack => a) -> a +rewriteYamlFile FilePath +filePath a -> a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -803,32 +803,32 @@ $ FilePath "Rewriting YAML file: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath +filePath forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ByteString lbsReadFile FilePath -filePath forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +filePath forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall a (m :: * -> *). (MonadTest m, FromJSON a, ToJSON a, HasCallStack) => (a -> a) -> ByteString -> m ByteString rewriteLbsYaml a -> a -f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> ByteString -> m () lbsWriteFile FilePath -filePath +filePath -- | Rewrite the 'filePath' YAML file using the function 'f'. -copyRewriteYamlFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => FilePath -> FilePath -> (a -> a) -> m () +copyRewriteYamlFile :: forall a m. (MonadTest m, MonadIO m, Y.FromJSON a, Y.ToJSON a, HasCallStack) => FilePath -> FilePath -> (a -> a) -> m () copyRewriteYamlFile :: forall a (m :: * -> *). (MonadTest m, MonadIO m, FromJSON a, ToJSON a, HasCallStack) => FilePath -> FilePath -> (a -> a) -> m () -copyRewriteYamlFile FilePath -src FilePath -dst a -> a -f = forall a. HasCallStack => (HasCallStack => a) -> a +copyRewriteYamlFile FilePath +src FilePath +dst a -> a +f = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -840,44 +840,44 @@ $ FilePath "Rewriting YAML from file: " forall a. Semigroup a => a -> a -> a <> FilePath -src forall a. Semigroup a => a -> a -> a +src forall a. Semigroup a => a -> a -> a <> FilePath " to file " forall a. Semigroup a => a -> a -> a <> FilePath -dst +dst forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ByteString lbsReadFile FilePath -src forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +src forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall a (m :: * -> *). (MonadTest m, FromJSON a, ToJSON a, HasCallStack) => (a -> a) -> ByteString -> m ByteString rewriteLbsYaml a -> a -f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +f forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> ByteString -> m () lbsWriteFile FilePath -dst +dst -- | Annotate the contents of the 'filePath' file. -cat :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () +cat :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () cat :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () -cat FilePath -filePath = forall a. HasCallStack => (HasCallStack => a) -> a +cat FilePath +filePath = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - !FilePath -contents <- forall (m :: * -> *) a. (Monad m, NFData a) => m a -> m a + !FilePath +contents <- forall (m :: * -> *) a. (Monad m, NFData a) => m a -> m a forceM forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m FilePath readFile FilePath -filePath +filePath forall (f :: * -> *) a. Functor f => f a -> f () void forall b c a. (b -> c) -> (a -> b) -> a -> c . forall (m :: * -> *). @@ -889,231 +889,231 @@ [ FilePath "━━━━ File: " forall a. Semigroup a => a -> a -> a <> FilePath -filePath forall a. Semigroup a => a -> a -> a +filePath forall a. Semigroup a => a -> a -> a <> FilePath " ━━━━" , FilePath -contents +contents ] forall (m :: * -> *) a. Monad m => a -> m a return () -- | Assert the 'filePath' can be parsed as JSON. -assertIsJsonFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () +assertIsJsonFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () assertIsJsonFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () -assertIsJsonFile FilePath -fp = forall a. HasCallStack => (HasCallStack => a) -> a +assertIsJsonFile FilePath +fp = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Either FilePath Value -jsonResult <- forall a (m :: * -> *). + Either FilePath Value +jsonResult <- forall a (m :: * -> *). (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m (Either FilePath a) readJsonFile @Value FilePath -fp +fp case Either FilePath Value -jsonResult of +jsonResult of Right Value _ -> forall (m :: * -> *) a. Monad m => a -> m a return () - Left FilePath -msg -> forall (m :: * -> *) a. MonadTest m => CallStack -> FilePath -> m a + Left FilePath +msg -> forall (m :: * -> *) a. MonadTest m => CallStack -> FilePath -> m a H.failMessage HasCallStack => CallStack GHC.callStack FilePath -msg +msg -- | Assert the 'filePath' can be parsed as YAML. -assertIsYamlFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () +assertIsYamlFile :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () assertIsYamlFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () -assertIsYamlFile FilePath -fp = forall a. HasCallStack => (HasCallStack => a) -> a +assertIsYamlFile FilePath +fp = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Either FilePath Value -result <- forall a (m :: * -> *). + Either FilePath Value +result <- forall a (m :: * -> *). (MonadTest m, MonadIO m, FromJSON a, HasCallStack) => FilePath -> m (Either FilePath a) readJsonFile @Value FilePath -fp +fp case Either FilePath Value -result of +result of Right Value _ -> forall (m :: * -> *) a. Monad m => a -> m a return () - Left FilePath -msg -> forall (m :: * -> *) a. MonadTest m => CallStack -> FilePath -> m a + Left FilePath +msg -> forall (m :: * -> *) a. MonadTest m => CallStack -> FilePath -> m a H.failMessage HasCallStack => CallStack GHC.callStack FilePath -msg +msg -- | Asserts that the given file exists. -assertFileExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () +assertFileExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () assertFileExists :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () -assertFileExists FilePath -file = forall a. HasCallStack => (HasCallStack => a) -> a +assertFileExists FilePath +file = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Bool -exists <- forall (m :: * -> *) a. + Bool +exists <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> IO Bool IO.doesFileExist FilePath -file +file forall (f :: * -> *). Applicative f => Bool -> f () -> f () unless Bool -exists forall a b. (a -> b) -> a -> b +exists forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. MonadTest m => CallStack -> Maybe Diff -> FilePath -> m a H.failWithCustom HasCallStack => CallStack GHC.callStack forall a. Maybe a Nothing (FilePath -file forall a. Semigroup a => a -> a -> a +file forall a. Semigroup a => a -> a -> a <> FilePath " has not been successfully created.") -- | Asserts that all of the given files exist. -assertFilesExist :: (MonadTest m, MonadIO m, HasCallStack) => [FilePath] -> m () +assertFilesExist :: (MonadTest m, MonadIO m, HasCallStack) => [FilePath] -> m () assertFilesExist :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => [FilePath] -> m () -assertFilesExist [FilePath] -files = forall a. HasCallStack => (HasCallStack => a) -> a +assertFilesExist [FilePath] +files = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ [FilePath] -files forall (m :: * -> *). +files forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () assertFileExists -- | Asserts that the given file is missing. -assertFileMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () +assertFileMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () assertFileMissing :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () -assertFileMissing FilePath -file = forall a. HasCallStack => (HasCallStack => a) -> a +assertFileMissing FilePath +file = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Bool -exists <- forall (m :: * -> *) a. + Bool +exists <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> IO Bool IO.doesFileExist FilePath -file +file forall (f :: * -> *). Applicative f => Bool -> f () -> f () when Bool -exists forall a b. (a -> b) -> a -> b +exists forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. MonadTest m => CallStack -> Maybe Diff -> FilePath -> m a H.failWithCustom HasCallStack => CallStack GHC.callStack forall a. Maybe a Nothing (FilePath -file forall a. Semigroup a => a -> a -> a +file forall a. Semigroup a => a -> a -> a <> FilePath " should not have been created.") -- | Asserts that all of the given files are missing. -assertFilesMissing :: (MonadTest m, MonadIO m, HasCallStack) => [FilePath] -> m () +assertFilesMissing :: (MonadTest m, MonadIO m, HasCallStack) => [FilePath] -> m () assertFilesMissing :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => [FilePath] -> m () -assertFilesMissing [FilePath] -files = forall a. HasCallStack => (HasCallStack => a) -> a +assertFilesMissing [FilePath] +files = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ forall (t :: * -> *) (f :: * -> *) a b. (Foldable t, Applicative f) => t a -> (a -> f b) -> f () for_ [FilePath] -files forall (m :: * -> *). +files forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () assertFileMissing -- | Assert the file contains the given number of occurrences of the given string -assertFileOccurences :: (MonadTest m, MonadIO m, HasCallStack) => Int -> String -> FilePath -> m () +assertFileOccurences :: (MonadTest m, MonadIO m, HasCallStack) => Int -> String -> FilePath -> m () assertFileOccurences :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => Int -> FilePath -> FilePath -> m () -assertFileOccurences Int -n FilePath -s FilePath -fp = forall a. HasCallStack => (HasCallStack => a) -> a +assertFileOccurences Int +n FilePath +s FilePath +fp = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - FilePath -contents <- forall (m :: * -> *). + FilePath +contents <- forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m FilePath readFile FilePath -fp +fp forall (t :: * -> *) a. Foldable t => t a -> Int L.length (forall a. (a -> Bool) -> [a] -> [a] L.filter (FilePath -s forall a. Eq a => [a] -> [a] -> Bool +s forall a. Eq a => [a] -> [a] -> Bool `L.isInfixOf`) (FilePath -> [FilePath] L.lines FilePath -contents)) forall (m :: * -> *) a. +contents)) forall (m :: * -> *) a. (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m () H.=== Int -n +n -- | Assert the file contains the given number of occurrences of the given string -assertFileLines :: (MonadTest m, MonadIO m, HasCallStack) => (Int -> Bool) -> FilePath -> m () +assertFileLines :: (MonadTest m, MonadIO m, HasCallStack) => (Int -> Bool) -> FilePath -> m () assertFileLines :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => (Int -> Bool) -> FilePath -> m () -assertFileLines Int -> Bool -p FilePath -fp = forall a. HasCallStack => (HasCallStack => a) -> a +assertFileLines Int -> Bool +p FilePath +fp = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - FilePath -contents <- forall (m :: * -> *). + FilePath +contents <- forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m FilePath readFile FilePath -fp +fp - let lines :: [FilePath] -lines = FilePath -> [FilePath] + let lines :: [FilePath] +lines = FilePath -> [FilePath] L.lines FilePath -contents +contents - let len :: Int -len = case forall a. [a] -> [a] + let len :: Int +len = case forall a. [a] -> [a] L.reverse [FilePath] -lines of +lines of FilePath -"":[FilePath] -xs -> forall (t :: * -> *) a. Foldable t => t a -> Int +"":[FilePath] +xs -> forall (t :: * -> *) a. Foldable t => t a -> Int L.length [FilePath] -xs - [FilePath] -xs -> forall (t :: * -> *) a. Foldable t => t a -> Int +xs + [FilePath] +xs -> forall (t :: * -> *) a. Foldable t => t a -> Int L.length [FilePath] -xs +xs forall (f :: * -> *). Applicative f => Bool -> f () -> f () unless (Int -> Bool -p Int -len) forall a b. (a -> b) -> a -> b +p Int +len) forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *) a. MonadTest m => @@ -1121,29 +1121,29 @@ H.failWithCustom HasCallStack => CallStack GHC.callStack forall a. Maybe a Nothing (FilePath -fp forall a. Semigroup a => a -> a -> a +fp forall a. Semigroup a => a -> a -> a <> FilePath " has an unexpected number of lines") -- | Assert the file contains the given number of occurrences of the given string -assertEndsWithSingleNewline :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () +assertEndsWithSingleNewline :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () assertEndsWithSingleNewline :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () -assertEndsWithSingleNewline FilePath -fp = forall a. HasCallStack => (HasCallStack => a) -> a +assertEndsWithSingleNewline FilePath +fp = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - FilePath -contents <- forall (m :: * -> *). + FilePath +contents <- forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m FilePath readFile FilePath -fp +fp case forall a. [a] -> [a] L.reverse FilePath -contents of +contents of Char '\n':Char '\n':FilePath @@ -1153,7 +1153,7 @@ H.failWithCustom HasCallStack => CallStack GHC.callStack forall a. Maybe a Nothing (FilePath -fp forall a. Semigroup a => a -> a -> a +fp forall a. Semigroup a => a -> a -> a <> FilePath " ends with too many newlines.") Char @@ -1167,62 +1167,62 @@ H.failWithCustom HasCallStack => CallStack GHC.callStack forall a. Maybe a Nothing (FilePath -fp forall a. Semigroup a => a -> a -> a +fp forall a. Semigroup a => a -> a -> a <> FilePath " must end with newline.") -- | Write 'contents' to the 'filePath' file. -appendFileTimeDelta :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> UTCTime -> m () +appendFileTimeDelta :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> UTCTime -> m () appendFileTimeDelta :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> UTCTime -> m () -appendFileTimeDelta FilePath -filePath UTCTime -offsetTime = forall a. HasCallStack => (HasCallStack => a) -> a +appendFileTimeDelta FilePath +filePath UTCTime +offsetTime = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - UTCTime -baseTime <- forall (m :: * -> *) a. + UTCTime +baseTime <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack, Show a) => IO a -> m a H.noteShowIO IO UTCTime DTC.getCurrentTime - let delay :: NominalDiffTime -delay = UTCTime -> UTCTime -> NominalDiffTime + let delay :: NominalDiffTime +delay = UTCTime -> UTCTime -> NominalDiffTime DTC.diffUTCTime UTCTime -baseTime UTCTime -offsetTime +baseTime UTCTime +offsetTime forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () appendFile FilePath -filePath forall a b. (a -> b) -> a -> b +filePath forall a b. (a -> b) -> a -> b $ forall a. Show a => a -> FilePath show @DTC.NominalDiffTime NominalDiffTime -delay forall a. Semigroup a => a -> a -> a +delay forall a. Semigroup a => a -> a -> a <> FilePath "\n" -- | Asserts that the given directory exists. -assertDirectoryExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () +assertDirectoryExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () assertDirectoryExists :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () -assertDirectoryExists FilePath -dir = forall a. HasCallStack => (HasCallStack => a) -> a +assertDirectoryExists FilePath +dir = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Bool -exists <- forall (m :: * -> *) a. + Bool +exists <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> IO Bool IO.doesDirectoryExist FilePath -dir +dir forall (f :: * -> *). Applicative f => Bool -> f () -> f () unless Bool -exists forall a b. (a -> b) -> a -> b +exists forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. MonadTest m => CallStack -> Maybe Diff -> FilePath -> m a @@ -1231,30 +1231,30 @@ Nothing (FilePath "Directory '" forall a. Semigroup a => a -> a -> a <> FilePath -dir forall a. Semigroup a => a -> a -> a +dir forall a. Semigroup a => a -> a -> a <> FilePath "' does not exist on the file system.") -- | Asserts that the given directory is missing. -assertDirectoryMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () +assertDirectoryMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () assertDirectoryMissing :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () -assertDirectoryMissing FilePath -dir = forall a. HasCallStack => (HasCallStack => a) -> a +assertDirectoryMissing FilePath +dir = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Bool -exists <- forall (m :: * -> *) a. + Bool +exists <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> IO Bool IO.doesDirectoryExist FilePath -dir +dir forall (f :: * -> *). Applicative f => Bool -> f () -> f () when Bool -exists forall a b. (a -> b) -> a -> b +exists forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. MonadTest m => CallStack -> Maybe Diff -> FilePath -> m a @@ -1263,7 +1263,7 @@ Nothing (FilePath "Directory '" forall a. Semigroup a => a -> a -> a <> FilePath -dir forall a. Semigroup a => a -> a -> a +dir forall a. Semigroup a => a -> a -> a <> FilePath "' does exist on the file system.") \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Test.Golden.html b/hedgehog-extras/src/Hedgehog.Extras.Test.Golden.html index 30cb7c69..1f3806dc 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Test.Golden.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Test.Golden.html @@ -42,7 +42,7 @@ 1 {-# NOINLINE sem #-} -semBracket :: IO a -> IO a +semBracket :: IO a -> IO a semBracket :: forall a. IO a -> IO a semBracket = forall a b c. IO a -> IO b -> IO c -> IO c bracket_ (QSem -> IO () @@ -67,14 +67,14 @@ createGoldenFiles = forall a. IO a -> a IO.unsafePerformIO forall a b. (a -> b) -> a -> b $ do - Maybe String -value <- String -> IO (Maybe String) + Maybe String +value <- String -> IO (Maybe String) IO.lookupEnv String "CREATE_GOLDEN_FILES" forall (m :: * -> *) a. Monad m => a -> m a return forall a b. (a -> b) -> a -> b $ Maybe String -value forall a. Eq a => a -> a -> Bool +value forall a. Eq a => a -> a -> Bool == forall a. a -> Maybe a Just String "1" @@ -85,31 +85,31 @@ recreateGoldenFiles = forall a. IO a -> a IO.unsafePerformIO forall a b. (a -> b) -> a -> b $ do - Maybe String -value <- String -> IO (Maybe String) + Maybe String +value <- String -> IO (Maybe String) IO.lookupEnv String "RECREATE_GOLDEN_FILES" forall (m :: * -> *) a. Monad m => a -> m a return forall a b. (a -> b) -> a -> b $ Maybe String -value forall a. Eq a => a -> a -> Bool +value forall a. Eq a => a -> a -> Bool == forall a. a -> Maybe a Just String "1" -writeGoldenFile :: () +writeGoldenFile :: () => HasCallStack - => MonadIO m - => MonadTest m + => MonadIO m + => MonadTest m => FilePath -> String - -> m () + -> m () writeGoldenFile :: forall (m :: * -> *). (HasCallStack, MonadIO m, MonadTest m) => String -> String -> m () -writeGoldenFile String -goldenFile String -actualContent = forall a. HasCallStack => (HasCallStack => a) -> a +writeGoldenFile String +goldenFile String +actualContent = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () @@ -117,31 +117,31 @@ $ String "Creating golden file " forall a. Semigroup a => a -> a -> a <> String -goldenFile +goldenFile forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => String -> m () H.createDirectoryIfMissing_ (String -> String takeDirectory String -goldenFile) +goldenFile) forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => String -> String -> m () H.writeFile String -goldenFile String -actualContent +goldenFile String +actualContent -reportGoldenFileMissing :: () +reportGoldenFileMissing :: () => HasCallStack - => MonadIO m - => MonadTest m + => MonadIO m + => MonadTest m => FilePath - -> m () + -> m () reportGoldenFileMissing :: forall (m :: * -> *). (HasCallStack, MonadIO m, MonadTest m) => String -> m () -reportGoldenFileMissing String -goldenFile = forall a. HasCallStack => (HasCallStack => a) -> a +reportGoldenFileMissing String +goldenFile = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () @@ -151,7 +151,7 @@ [ String "Golden file " forall a. Semigroup a => a -> a -> a <> String -goldenFile forall a. Semigroup a => a -> a -> a +goldenFile forall a. Semigroup a => a -> a -> a <> String " does not exist." , String @@ -162,36 +162,36 @@ forall (m :: * -> *) a. (MonadTest m, HasCallStack) => m a H.failure -checkAgainstGoldenFile :: () +checkAgainstGoldenFile :: () => HasCallStack - => MonadIO m - => MonadTest m + => MonadIO m + => MonadTest m => FilePath -> [String] - -> m () + -> m () checkAgainstGoldenFile :: forall (m :: * -> *). (HasCallStack, MonadIO m, MonadTest m) => String -> [String] -> m () -checkAgainstGoldenFile String -goldenFile [String] -actualLines = forall a. HasCallStack => (HasCallStack => a) -> a +checkAgainstGoldenFile String +goldenFile [String] +actualLines = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - [String] -referenceLines <- String -> [String] + [String] +referenceLines <- String -> [String] List.lines forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => String -> m String H.readFile String -goldenFile - let difference :: [Diff [String]] -difference = forall a. Eq a => [a] -> [a] -> [Diff [a]] +goldenFile + let difference :: [Diff [String]] +difference = forall a. Eq a => [a] -> [a] -> [Diff [a]] getGroupedDiff [String] -actualLines [String] -referenceLines +actualLines [String] +referenceLines case [Diff [String]] -difference of +difference of [] -> forall (f :: * -> *) a. Applicative f => a -> f a pure () [Both{}] -> forall (f :: * -> *) a. Applicative f => a -> f a @@ -212,7 +212,7 @@ callStack forall a b. (a -> b) -> a -> b $ [Diff [String]] -> String ppDiff [Diff [String]] -difference +difference -- | 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 @@ -229,18 +229,18 @@ -- -- TODO: Improve the help output by saying the difference of -- each input. -diffVsGoldenFile +diffVsGoldenFile :: HasCallStack - => (MonadIO m, MonadTest m) + => (MonadIO m, MonadTest m) => String -- ^ Actual content -> FilePath -- ^ Reference file - -> m () + -> m () diffVsGoldenFile :: forall (m :: * -> *). (HasCallStack, MonadIO m, MonadTest m) => String -> String -> m () -diffVsGoldenFile String -actualContent String -goldenFile = forall a. HasCallStack => (HasCallStack => a) -> a +diffVsGoldenFile String +actualContent String +goldenFile = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (t :: * -> *) (m :: * -> *) a b. @@ -248,26 +248,26 @@ t a -> (a -> m b) -> m () forM_ Maybe String mGoldenFileLogFile forall a b. (a -> b) -> a -> b -$ \String -logFile -> +$ \String +logFile -> forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ forall a. IO a -> IO a semBracket forall a b. (a -> b) -> a -> b $ String -> String -> IO () IO.appendFile String -logFile forall a b. (a -> b) -> a -> b +logFile forall a b. (a -> b) -> a -> b $ String -goldenFile forall a. Semigroup a => a -> a -> a +goldenFile forall a. Semigroup a => a -> a -> a <> String "\n" - Bool -fileExists <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + Bool +fileExists <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ String -> IO Bool IO.doesFileExist String -goldenFile +goldenFile if | Bool @@ -275,34 +275,34 @@ (HasCallStack, MonadIO m, MonadTest m) => String -> String -> m () writeGoldenFile String -goldenFile String -actualContent +goldenFile String +actualContent | Bool -fileExists -> forall (m :: * -> *). +fileExists -> forall (m :: * -> *). (HasCallStack, MonadIO m, MonadTest m) => String -> [String] -> m () checkAgainstGoldenFile String -goldenFile [String] -actualLines +goldenFile [String] +actualLines | Bool createGoldenFiles -> forall (m :: * -> *). (HasCallStack, MonadIO m, MonadTest m) => String -> String -> m () writeGoldenFile String -goldenFile String -actualContent +goldenFile String +actualContent | Bool otherwise -> forall (m :: * -> *). (HasCallStack, MonadIO m, MonadTest m) => String -> m () reportGoldenFileMissing String -goldenFile +goldenFile where - actualLines :: [String] -actualLines = String -> [String] + actualLines :: [String] +actualLines = String -> [String] List.lines String -actualContent +actualContent -- | 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 @@ -315,30 +315,30 @@ -- -- To re-generate a golden file you must also delete the golden file because golden -- files are never overwritten. -diffFileVsGoldenFile +diffFileVsGoldenFile :: HasCallStack - => (MonadIO m, MonadTest m) + => (MonadIO m, MonadTest m) => FilePath -- ^ Actual file -> FilePath -- ^ Reference file - -> m () + -> m () diffFileVsGoldenFile :: forall (m :: * -> *). (HasCallStack, MonadIO m, MonadTest m) => String -> String -> m () -diffFileVsGoldenFile String -actualFile String -referenceFile = forall a. HasCallStack => (HasCallStack => a) -> a +diffFileVsGoldenFile String +actualFile String +referenceFile = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - String -contents <- forall (m :: * -> *). + String +contents <- forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => String -> m String H.readFile String -actualFile +actualFile forall (m :: * -> *). (HasCallStack, MonadIO m, MonadTest m) => String -> String -> m () diffVsGoldenFile String -contents String -referenceFile +contents String +referenceFile \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Test.MonadAssertion.html b/hedgehog-extras/src/Hedgehog.Extras.Test.MonadAssertion.html index 1a8bf3a5..22a02875 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Test.MonadAssertion.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Test.MonadAssertion.html @@ -17,24 +17,24 @@ import qualified Hedgehog as H import qualified Hedgehog.Internal.Property as H -class Monad m => MonadAssertion m where - throwAssertion :: H.Failure -> m a - catchAssertion :: m a -> (H.Failure -> m a) -> m a +class Monad m => MonadAssertion m where + throwAssertion :: H.Failure -> m a + catchAssertion :: m a -> (H.Failure -> m a) -> m a -instance Monad m => MonadAssertion (H.TestT m) where - throwAssertion :: forall a. Failure -> TestT m a -throwAssertion Failure -f = forall (m :: * -> *) a. MonadTest m => Test a -> m a +instance Monad m => MonadAssertion (H.TestT m) where + throwAssertion :: forall a. Failure -> TestT m a +throwAssertion Failure +f = forall (m :: * -> *) a. MonadTest m => Test a -> m a H.liftTest forall a b. (a -> b) -> a -> b $ forall a. (Either Failure a, Journal) -> Test a H.mkTest (forall a b. a -> Either a b Left Failure -f, forall a. Monoid a => a +f, forall a. Monoid a => a mempty) - catchAssertion :: forall a. TestT m a -> (Failure -> TestT m a) -> TestT m a -catchAssertion TestT m a -g Failure -> TestT m a -h = forall (m :: * -> *) a. + catchAssertion :: forall a. TestT m a -> (Failure -> TestT m a) -> TestT m a +catchAssertion TestT m a +g Failure -> TestT m a +h = forall (m :: * -> *) a. ExceptT Failure (WriterT Journal m) a -> TestT m a H.TestT forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) e a e'. @@ -43,39 +43,39 @@ E.catchE (forall (m :: * -> *) a. TestT m a -> ExceptT Failure (WriterT Journal m) a H.unTest TestT m a -g) (forall (m :: * -> *) a. +g) (forall (m :: * -> *) a. TestT m a -> ExceptT Failure (WriterT Journal m) a H.unTest forall b c a. (b -> c) -> (a -> b) -> a -> c . Failure -> TestT m a -h) +h) -instance MonadAssertion m => MonadAssertion (IO.ResourceT m) where - throwAssertion :: forall a. Failure -> ResourceT m a -throwAssertion = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. +instance MonadAssertion m => MonadAssertion (IO.ResourceT m) where + throwAssertion :: forall a. Failure -> ResourceT m a +throwAssertion = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift forall b c a. (b -> c) -> (a -> b) -> a -> c . forall (m :: * -> *) a. MonadAssertion m => Failure -> m a throwAssertion - catchAssertion :: forall a. + catchAssertion :: forall a. ResourceT m a -> (Failure -> ResourceT m a) -> ResourceT m a -catchAssertion ResourceT m a -r Failure -> ResourceT m a -h = forall (m :: * -> *) a. (IORef ReleaseMap -> m a) -> ResourceT m a +catchAssertion ResourceT m a +r Failure -> ResourceT m a +h = forall (m :: * -> *) a. (IORef ReleaseMap -> m a) -> ResourceT m a IO.ResourceT forall a b. (a -> b) -> a -> b -$ \IORef ReleaseMap -i -> forall (m :: * -> *) a. ResourceT m a -> IORef ReleaseMap -> m a +$ \IORef ReleaseMap +i -> forall (m :: * -> *) a. ResourceT m a -> IORef ReleaseMap -> m a IO.unResourceT ResourceT m a -r IORef ReleaseMap -i forall (m :: * -> *) a. +r IORef ReleaseMap +i forall (m :: * -> *) a. MonadAssertion m => m a -> (Failure -> m a) -> m a -`catchAssertion` \Failure -e -> forall (m :: * -> *) a. ResourceT m a -> IORef ReleaseMap -> m a +`catchAssertion` \Failure +e -> forall (m :: * -> *) a. ResourceT m a -> IORef ReleaseMap -> m a IO.unResourceT (Failure -> ResourceT m a -h Failure -e) IORef ReleaseMap -i +h Failure +e) IORef ReleaseMap +i -deriving instance Monad m => MonadAssertion (H.PropertyT m) +deriving instance Monad m => MonadAssertion (H.PropertyT m) \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Test.Network.html b/hedgehog-extras/src/Hedgehog.Extras.Test.Network.html index 48178b03..0a005578 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Test.Network.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Test.Network.html @@ -47,7 +47,7 @@ import qualified System.FilePath as FP -- | Test if a file exists -doesFileExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m Bool +doesFileExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m Bool doesFileExists :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m Bool @@ -61,12 +61,12 @@ IO.doesFileExist -- | Test if a port is open -isPortOpen :: (MonadTest m, MonadIO m, HasCallStack) => Int -> m Bool +isPortOpen :: (MonadTest m, MonadIO m, HasCallStack) => Int -> m Bool isPortOpen :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => Int -> m Bool -isPortOpen Int -port = forall a. HasCallStack => (HasCallStack => a) -> a +isPortOpen Int +port = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). @@ -77,17 +77,17 @@ "Port: " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> FilePath show Int -port +port forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ Int -> IO Bool IO.isPortOpen Int -port +port -- | Test if a socket file exists -doesSocketExist :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m Bool +doesSocketExist :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m Bool doesSocketExist :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m Bool @@ -101,7 +101,7 @@ IO.doesSocketExist -- | Assert that a port is open -assertPortOpen :: (MonadTest m, MonadIO m, HasCallStack) => Int -> m () +assertPortOpen :: (MonadTest m, MonadIO m, HasCallStack) => Int -> m () assertPortOpen :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => Int -> m () @@ -115,7 +115,7 @@ isPortOpen -- | Assert that a socket file exists is open -assertSocketExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () +assertSocketExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () assertSocketExists :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m () @@ -129,16 +129,16 @@ doesSocketExist -- | Test if the sprocket exists -doesSprocketExist :: (MonadTest m, MonadIO m, HasCallStack) => Sprocket -> m Bool +doesSprocketExist :: (MonadTest m, MonadIO m, HasCallStack) => Sprocket -> m Bool doesSprocketExist :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => Sprocket -> m Bool -doesSprocketExist Sprocket -socket = forall a. HasCallStack => (HasCallStack => a) -> a +doesSprocketExist Sprocket +socket = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Either IOException Bool -waitResult <- forall (m :: * -> *) a. + Either IOException Bool +waitResult <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -149,19 +149,19 @@ then FilePath -> IO Bool IO.doesNamedPipeExist (Sprocket -> FilePath sprocketSystemName Sprocket -socket) +socket) else FilePath -> IO Bool IO.doesSocketExist (Sprocket -> FilePath sprocketSystemName Sprocket -socket) +socket) case Either IOException Bool -waitResult of - Right Bool -result -> forall (m :: * -> *) a. Monad m => a -> m a +waitResult of + Right Bool +result -> forall (m :: * -> *) a. Monad m => a -> m a return Bool -result - Left (IOException -e :: IOException) -> do +result + Left (IOException +e :: IOException) -> do forall (m :: * -> *). (MonadTest m, HasCallStack) => FilePath -> m () @@ -170,19 +170,19 @@ "Error: " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> FilePath show IOException -e +e forall (m :: * -> *) a. Monad m => a -> m a return Bool False -- | Download from a URl to a file -downloadToFile :: (MonadTest m, MonadIO m, HasCallStack) => String -> FilePath -> m () +downloadToFile :: (MonadTest m, MonadIO m, HasCallStack) => String -> FilePath -> m () downloadToFile :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> m () -downloadToFile FilePath -url FilePath -path = forall a. HasCallStack => (HasCallStack => a) -> a +downloadToFile FilePath +url FilePath +path = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). @@ -192,90 +192,90 @@ $ FilePath "Downloading " forall a. Semigroup a => a -> a -> a <> FilePath -url forall a. Semigroup a => a -> a -> a +url forall a. Semigroup a => a -> a -> a <> FilePath " to " forall a. Semigroup a => a -> a -> a <> FilePath -path +path forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadIO m => FilePath -> m ByteString HTTP.simpleHttp FilePath -url forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +url forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= FilePath -> ByteString -> IO () LBS.writeFile FilePath -path +path -tarErrors :: TAR.GenEntries tarPath linkTarget e -> [e] +tarErrors :: TAR.GenEntries tarPath linkTarget e -> [e] tarErrors :: forall tarPath linkTarget e. GenEntries tarPath linkTarget e -> [e] -tarErrors GenEntries tarPath linkTarget e -entries = forall tarPath linkTarget a e. +tarErrors GenEntries tarPath linkTarget e +entries = forall tarPath linkTarget a e. (GenEntry tarPath linkTarget -> a -> a) -> a -> (e -> a) -> GenEntries tarPath linkTarget e -> a TAR.foldEntries (forall a b c. (a -> b -> c) -> b -> a -> c flip forall a b. a -> b -> a const) forall a. a -> a id (:) GenEntries tarPath linkTarget e -entries [] +entries [] -- | Download a github commit to a temporary directory, extract it and return the path to the extracted directory. -- -- If the file is already downloaded, it will not be downloaded again. -- If the file is already extracted, it will not be extracted again. -downloadAndExtractGithubCommitToTemp :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> String -> m FilePath +downloadAndExtractGithubCommitToTemp :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> String -> String -> m FilePath downloadAndExtractGithubCommitToTemp :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => FilePath -> FilePath -> FilePath -> m FilePath -downloadAndExtractGithubCommitToTemp FilePath -dir FilePath -repository FilePath -commit = forall a. HasCallStack => (HasCallStack => a) -> a +downloadAndExtractGithubCommitToTemp FilePath +dir FilePath +repository FilePath +commit = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - let url :: FilePath -url = FilePath + let url :: FilePath +url = FilePath "https://github.com/" forall a. Semigroup a => a -> a -> a <> FilePath -repository forall a. Semigroup a => a -> a -> a +repository forall a. Semigroup a => a -> a -> a <> FilePath "/archive/" forall a. Semigroup a => a -> a -> a <> FilePath -commit forall a. Semigroup a => a -> a -> a +commit forall a. Semigroup a => a -> a -> a <> FilePath ".tar.gz" - let topDir :: FilePath -topDir = FilePath -> FilePath + let topDir :: FilePath +topDir = FilePath -> FilePath FP.takeFileName FilePath -repository forall a. Semigroup a => a -> a -> a +repository forall a. Semigroup a => a -> a -> a <> FilePath "-" forall a. Semigroup a => a -> a -> a <> FilePath -commit - let tarPath :: FilePath -tarPath = FilePath -dir FilePath -> FilePath -> FilePath +commit + let tarPath :: FilePath +tarPath = FilePath +dir FilePath -> FilePath -> FilePath </> FilePath -topDir forall a. Semigroup a => a -> a -> a +topDir forall a. Semigroup a => a -> a -> a <> FilePath ".tar.gz" - let dest :: FilePath -dest = FilePath -dir FilePath -> FilePath -> FilePath + let dest :: FilePath +dest = FilePath +dir FilePath -> FilePath -> FilePath </> FilePath -topDir +topDir - Bool -tarFileExists <- forall (m :: * -> *) a. + Bool +tarFileExists <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> IO Bool IO.doesFileExist FilePath -tarPath +tarPath if Bool -tarFileExists +tarFileExists then forall (m :: * -> *). (MonadTest m, HasCallStack) => FilePath -> m () @@ -283,11 +283,11 @@ $ FilePath "Already downloaded " forall a. Semigroup a => a -> a -> a <> FilePath -url forall a. Semigroup a => a -> a -> a +url forall a. Semigroup a => a -> a -> a <> FilePath " to " forall a. Semigroup a => a -> a -> a <> FilePath -tarPath +tarPath else do forall (m :: * -> *). (MonadTest m, HasCallStack) => @@ -296,32 +296,32 @@ $ FilePath "Downloading " forall a. Semigroup a => a -> a -> a <> FilePath -url forall a. Semigroup a => a -> a -> a +url forall a. Semigroup a => a -> a -> a <> FilePath " to " forall a. Semigroup a => a -> a -> a <> FilePath -tarPath +tarPath forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadIO m => FilePath -> m ByteString HTTP.simpleHttp FilePath -url forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +url forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= FilePath -> ByteString -> IO () LBS.writeFile FilePath -tarPath +tarPath - Bool -destExists <- forall (m :: * -> *) a. + Bool +destExists <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ FilePath -> IO Bool IO.doesDirectoryExist FilePath -dest +dest if Bool -destExists +destExists then forall (m :: * -> *). (MonadTest m, HasCallStack) => FilePath -> m () @@ -329,11 +329,11 @@ $ FilePath "Already extracted " forall a. Semigroup a => a -> a -> a <> FilePath -tarPath forall a. Semigroup a => a -> a -> a +tarPath forall a. Semigroup a => a -> a -> a <> FilePath " to " forall a. Semigroup a => a -> a -> a <> FilePath -dest +dest else do forall (m :: * -> *). (MonadTest m, HasCallStack) => @@ -342,13 +342,13 @@ $ FilePath "Extracting " forall a. Semigroup a => a -> a -> a <> FilePath -tarPath forall a. Semigroup a => a -> a -> a +tarPath forall a. Semigroup a => a -> a -> a <> FilePath " to " forall a. Semigroup a => a -> a -> a <> FilePath -dest - [Either (Either FormatError DecodeLongNamesError) TarBombError] -errors <- forall (m :: * -> *) a. +dest + [Either (Either FormatError DecodeLongNamesError) TarBombError] +errors <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b @@ -362,19 +362,19 @@ FilePath (Either (Either e DecodeLongNamesError) TarBombError) TAR.checkTarbomb FilePath -topDir forall b c a. (b -> c) -> (a -> b) -> a -> c +topDir forall b c a. (b -> c) -> (a -> b) -> a -> c . ByteString -> Entries FormatError TAR.read forall b c a. (b -> c) -> (a -> b) -> a -> c . ByteString -> ByteString GZ.decompress forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> FilePath -> IO ByteString LBS.readFile FilePath -tarPath +tarPath forall (f :: * -> *). Applicative f => Bool -> f () -> f () unless (forall (t :: * -> *) a. Foldable t => t a -> Bool List.null [Either (Either FormatError DecodeLongNamesError) TarBombError] -errors) forall a b. (a -> b) -> a -> b +errors) forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). (MonadTest m, HasCallStack) => @@ -384,7 +384,7 @@ "Errors: " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> FilePath show [Either (Either FormatError DecodeLongNamesError) TarBombError] -errors +errors forall (m :: * -> *) a. (MonadTest m, HasCallStack) => m a H.failure @@ -394,14 +394,14 @@ H.evalIO forall a b. (a -> b) -> a -> b $ forall e. Exception e => FilePath -> Entries e -> IO () TAR.unpack FilePath -dir forall b c a. (b -> c) -> (a -> b) -> a -> c +dir forall b c a. (b -> c) -> (a -> b) -> a -> c . ByteString -> Entries FormatError TAR.read forall b c a. (b -> c) -> (a -> b) -> a -> c . ByteString -> ByteString GZ.decompress forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b =<< FilePath -> IO ByteString LBS.readFile FilePath -tarPath +tarPath forall (f :: * -> *) a. Functor f => f a -> f () void forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -411,11 +411,11 @@ H.assertIO forall a b. (a -> b) -> a -> b $ FilePath -> IO Bool H.doesDirectoryExist FilePath -dest +dest forall (m :: * -> *). (MonadTest m, HasCallStack) => FilePath -> m FilePath H.note FilePath -dest +dest \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Test.Process.html b/hedgehog-extras/src/Hedgehog.Extras.Test.Process.html index 587bf62e..dfeb369d 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Test.Process.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Test.Process.html @@ -25,7 +25,7 @@ , defaultExecConfig ) where -import Control.Monad (Monad (..), MonadFail (fail), void) +import Control.Monad (Monad (..), MonadFail (fail), void, unless) import Control.Monad.Catch (MonadCatch) import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.Trans.Resource (MonadResource, ReleaseKey, register) @@ -68,12 +68,12 @@ import qualified System.Process as IO -- | Configuration for starting a new process. This is a subset of 'IO.CreateProcess'. -data ExecConfig = ExecConfig +data ExecConfig = ExecConfig { ExecConfig -> Last [([Char], [Char])] execConfigEnv :: Last [(String, String)] , ExecConfig -> Last [Char] execConfigCwd :: Last FilePath - } deriving (ExecConfig -> ExecConfig -> Bool + } deriving (ExecConfig -> ExecConfig -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: ExecConfig -> ExecConfig -> Bool $c/= :: ExecConfig -> ExecConfig -> Bool @@ -85,7 +85,7 @@ (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep ExecConfig x -> ExecConfig $cfrom :: forall x. ExecConfig -> Rep ExecConfig x -Generic, Int -> ExecConfig -> ShowS +Generic, Int -> ExecConfig -> ShowS [ExecConfig] -> ShowS ExecConfig -> [Char] forall a. @@ -115,175 +115,178 @@ findDefaultPlanJsonFile = IO [Char] IO.getCurrentDirectory forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= [Char] -> IO [Char] -go - where go :: FilePath -> IO FilePath - go :: [Char] -> IO [Char] -go [Char] -d = do - let file :: [Char] -file = [Char] -d [Char] -> ShowS -</> [Char] +go + where go :: FilePath -> IO FilePath + go :: [Char] -> IO [Char] +go [Char] +d = do + let planRelPath :: [Char] +planRelPath = [Char] "dist-newstyle/cache/plan.json" - Bool -exists <- [Char] -> IO Bool + file :: [Char] +file = [Char] +d [Char] -> ShowS +</> [Char] +planRelPath + Bool +exists <- [Char] -> IO Bool IO.doesFileExist [Char] -file - if Bool -exists - then forall (m :: * -> *) a. Monad m => a -> m a +file + if Bool +exists + then forall (m :: * -> *) a. Monad m => a -> m a return [Char] -file - else do - let parent :: [Char] -parent = ShowS +file + else do + let parent :: [Char] +parent = ShowS takeDirectory [Char] -d - if [Char] -parent forall a. Eq a => a -> a -> Bool +d + if [Char] +parent forall a. Eq a => a -> a -> Bool == [Char] -d - then forall (m :: * -> *) a. Monad m => a -> m a +d + then forall (m :: * -> *) a. Monad m => a -> m a return [Char] -"dist-newstyle/cache/plan.json" - else [Char] -> IO [Char] -go [Char] -parent - --- | Discover the location of the plan.json file. -planJsonFile :: String -planJsonFile :: [Char] +planRelPath + else [Char] -> IO [Char] +go [Char] +parent + +-- | Discover the location of the plan.json file. +planJsonFile :: String +planJsonFile :: [Char] planJsonFile = forall a. IO a -> a IO.unsafePerformIO forall a b. (a -> b) -> a -> b $ do - Maybe [Char] -maybeBuildDir <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + Maybe [Char] +maybeBuildDir <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ [Char] -> IO (Maybe [Char]) IO.lookupEnv [Char] "CABAL_BUILDDIR" - case Maybe [Char] -maybeBuildDir of - Just [Char] -buildDir -> forall (m :: * -> *) a. Monad m => a -> m a + case Maybe [Char] +maybeBuildDir of + Just [Char] +buildDir -> forall (m :: * -> *) a. Monad m => a -> m a return forall a b. (a -> b) -> a -> b $ [Char] ".." [Char] -> ShowS </> [Char] -buildDir [Char] -> ShowS +buildDir [Char] -> ShowS </> [Char] "cache/plan.json" - Maybe [Char] + Maybe [Char] Nothing -> IO [Char] findDefaultPlanJsonFile -{-# NOINLINE planJsonFile #-} - -exeSuffix :: String -exeSuffix :: [Char] +{-# NOINLINE planJsonFile #-} + +exeSuffix :: String +exeSuffix :: [Char] exeSuffix = if Bool OS.isWin32 then [Char] ".exe" else [Char] "" - -addExeSuffix :: String -> String -addExeSuffix :: ShowS -addExeSuffix [Char] -s = if [Char] + +addExeSuffix :: String -> String +addExeSuffix :: ShowS +addExeSuffix [Char] +s = if [Char] ".exe" forall a. Eq a => [a] -> [a] -> Bool `L.isSuffixOf` [Char] -s - then [Char] -s - else [Char] -s forall a. Semigroup a => a -> a -> a +s + then [Char] +s + else [Char] +s forall a. Semigroup a => a -> a -> a <> [Char] exeSuffix - --- | Create a process returning handles to stdin, stdout, and stderr as well as the process handle. -createProcess - :: (MonadTest m, MonadResource m, HasCallStack) - => CreateProcess - -> m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle, ReleaseKey) -createProcess :: forall (m :: * -> *). + +-- | Create a process returning handles to stdin, stdout, and stderr as well as the process handle. +createProcess + :: (MonadTest m, MonadResource m, HasCallStack) + => CreateProcess + -> m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle, ReleaseKey) +createProcess :: forall (m :: * -> *). (MonadTest m, MonadResource m, HasCallStack) => CreateProcess -> m (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle, ReleaseKey) -createProcess CreateProcess -cp = forall a. HasCallStack => (HasCallStack => a) -> a +createProcess CreateProcess +cp = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () + forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () H.annotate forall a b. (a -> b) -> a -> b $ [Char] "CWD: " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> [Char] show (CreateProcess -> Maybe [Char] IO.cwd CreateProcess -cp) - case CreateProcess -> CmdSpec +cp) + case CreateProcess -> CmdSpec IO.cmdspec CreateProcess -cp of - RawCommand [Char] -cmd [[Char]] -args -> forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () +cp of + RawCommand [Char] +cmd [[Char]] +args -> forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () H.annotate forall a b. (a -> b) -> a -> b $ [Char] "Command line: " forall a. Semigroup a => a -> a -> a <> [Char] -cmd forall a. Semigroup a => a -> a -> a +cmd forall a. Semigroup a => a -> a -> a <> [Char] " " forall a. Semigroup a => a -> a -> a <> [[Char]] -> [Char] L.unwords [[Char]] -args - ShellCommand [Char] -cmd -> forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () +args + ShellCommand [Char] +cmd -> forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () H.annotate forall a b. (a -> b) -> a -> b $ [Char] "Command line: " forall a. Semigroup a => a -> a -> a <> [Char] -cmd - (Maybe Handle -mhStdin, Maybe Handle -mhStdout, Maybe Handle -mhStderr, ProcessHandle -hProcess) <- forall (m :: * -> *) a. +cmd + (Maybe Handle +mhStdin, Maybe Handle +mhStdout, Maybe Handle +mhStderr, ProcessHandle +hProcess) <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) IO.createProcess CreateProcess -cp - ReleaseKey -releaseKey <- forall (m :: * -> *). MonadResource m => IO () -> m ReleaseKey +cp + ReleaseKey +releaseKey <- forall (m :: * -> *). MonadResource m => IO () -> m ReleaseKey register forall a b. (a -> b) -> a -> b $ (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO () IO.cleanupProcess (Maybe Handle -mhStdin, Maybe Handle -mhStdout, Maybe Handle -mhStderr, ProcessHandle -hProcess) - - forall (m :: * -> *) a. Monad m => a -> m a +mhStdin, Maybe Handle +mhStdout, Maybe Handle +mhStderr, ProcessHandle +hProcess) + + forall (m :: * -> *) a. Monad m => a -> m a return (Maybe Handle -mhStdin, Maybe Handle -mhStdout, Maybe Handle -mhStderr, ProcessHandle -hProcess, ReleaseKey -releaseKey) - --- | Get the process ID. -getPid - :: (MonadTest m, MonadIO m, HasCallStack) - => ProcessHandle - -> m (Maybe Pid) -getPid :: forall (m :: * -> *). +mhStdin, Maybe Handle +mhStdout, Maybe Handle +mhStderr, ProcessHandle +hProcess, ReleaseKey +releaseKey) + +-- | Get the process ID. +getPid + :: (MonadTest m, MonadIO m, HasCallStack) + => ProcessHandle + -> m (Maybe Pid) +getPid :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => ProcessHandle -> m (Maybe Pid) -getPid ProcessHandle -hProcess = forall a. HasCallStack => (HasCallStack => a) -> a +getPid ProcessHandle +hProcess = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => @@ -291,21 +294,21 @@ H.evalIO forall a b. (a -> b) -> a -> b $ ProcessHandle -> IO (Maybe Pid) IO.getPid ProcessHandle -hProcess - --- | Get the process ID. -getPidOk - :: (MonadTest m, MonadIO m, HasCallStack) - => ProcessHandle - -> m Pid -getPidOk :: forall (m :: * -> *). +hProcess + +-- | Get the process ID. +getPidOk + :: (MonadTest m, MonadIO m, HasCallStack) + => ProcessHandle + -> m Pid +getPidOk :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => ProcessHandle -> m Pid -getPidOk ProcessHandle -hProcess = forall a. HasCallStack => (HasCallStack => a) -> a +getPidOk ProcessHandle +hProcess = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ - forall (m :: * -> *) a. + forall (m :: * -> *) a. (MonadTest m, HasCallStack) => m (Maybe a) -> m a H.nothingFailM forall a b. (a -> b) -> a -> b @@ -313,24 +316,24 @@ (MonadTest m, MonadIO m, HasCallStack) => ProcessHandle -> m (Maybe Pid) getPid ProcessHandle -hProcess - --- | Create a process returning its stdout. --- --- Being a 'flex' function means that the environment determines how the process is launched. --- --- When running in a nix environment, the 'envBin' argument describes the environment variable --- that defines the binary to use to launch the process. --- --- When running outside a nix environment, the `pkgBin` describes the name of the binary --- to launch via cabal exec. -execFlex - :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) - => String - -> String - -> [String] - -> m String -execFlex :: forall (m :: * -> *). +hProcess + +-- | Create a process returning its stdout. +-- +-- Being a 'flex' function means that the environment determines how the process is launched. +-- +-- When running in a nix environment, the 'envBin' argument describes the environment variable +-- that defines the binary to use to launch the process. +-- +-- When running outside a nix environment, the `pkgBin` describes the name of the binary +-- to launch via cabal exec. +execFlex + :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) + => String + -> String + -> [String] + -> m String +execFlex :: forall (m :: * -> *). (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => [Char] -> [Char] -> [[Char]] -> m [Char] execFlex = forall (m :: * -> *). @@ -338,418 +341,435 @@ ExecConfig -> [Char] -> [Char] -> [[Char]] -> m [Char] execFlex' ExecConfig defaultExecConfig - -execFlex' - :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) - => ExecConfig - -> String + +execFlex' + :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) + => ExecConfig -> String - -> [String] - -> m String -execFlex' :: forall (m :: * -> *). + -> String + -> [String] + -> m String +execFlex' :: forall (m :: * -> *). (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => ExecConfig -> [Char] -> [Char] -> [[Char]] -> m [Char] -execFlex' ExecConfig -execConfig [Char] -pkgBin [Char] -envBin [[Char]] -arguments = forall a. HasCallStack => (HasCallStack => a) -> a +execFlex' ExecConfig +execConfig [Char] +pkgBin [Char] +envBin [[Char]] +arguments = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - (ExitCode -exitResult, [Char] -stdout, [Char] -stderr) <- forall (m :: * -> *). + (ExitCode +exitResult, [Char] +stdout, [Char] +stderr) <- forall (m :: * -> *). (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => ExecConfig -> [Char] -> [Char] -> [[Char]] -> m (ExitCode, [Char], [Char]) execFlexAny' ExecConfig -execConfig [Char] -pkgBin [Char] -envBin [[Char]] -arguments - case ExitCode -exitResult of - IO.ExitFailure Int -exitCode -> do - forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () +execConfig [Char] +pkgBin [Char] +envBin [[Char]] +arguments + case ExitCode +exitResult of + IO.ExitFailure Int +exitCode -> do + forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () H.annotate forall a b. (a -> b) -> a -> b $ [[Char]] -> [Char] L.unlines forall a b. (a -> b) -> a -> b $ - [ [Char] + [ [Char] "Process exited with non-zero exit-code: " forall a. [a] -> [a] -> [a] ++ forall a. Show a => a -> [Char] show @Int Int -exitCode ] - forall a. [a] -> [a] -> [a] +exitCode ] + forall a. [a] -> [a] -> [a] ++ (if forall (t :: * -> *) a. Foldable t => t a -> Bool L.null [Char] -stdout then [] else [[Char] +stdout then [] else [[Char] "━━━━ stdout ━━━━" , [Char] -stdout]) - forall a. [a] -> [a] -> [a] +stdout]) + forall a. [a] -> [a] -> [a] ++ (if forall (t :: * -> *) a. Foldable t => t a -> Bool L.null [Char] -stderr then [] else [[Char] +stderr then [] else [[Char] "━━━━ stderr ━━━━" , [Char] -stderr]) - forall (m :: * -> *) a. MonadTest m => CallStack -> [Char] -> m a +stderr]) + forall (m :: * -> *) a. MonadTest m => CallStack -> [Char] -> m a H.failMessage HasCallStack => CallStack GHC.callStack [Char] "Execute process failed" - ExitCode + ExitCode IO.ExitSuccess -> forall (m :: * -> *) a. Monad m => a -> m a return [Char] -stdout - --- | Run a process, returning its exit code, its stdout, and its stderr. --- Contrary to @execFlex'@, this function doesn't fail if the call fails. --- So, if you want to test something negative, this is the function to use. -execFlexAny' - :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) - => ExecConfig - -> String -- ^ @pkgBin@: name of the binary to launch via 'cabal exec' - -> String -- ^ @envBin@: environment variable defining the binary to launch the process, when in Nix - -> [String] - -> m (ExitCode, String, String) -- ^ exit code, stdout, stderr -execFlexAny' :: forall (m :: * -> *). +stdout + +-- | Run a process, returning its exit code, its stdout, and its stderr. +-- Contrary to @execFlex'@, this function doesn't fail if the call fails. +-- So, if you want to test something negative, this is the function to use. +execFlexAny' + :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) + => ExecConfig + -> String -- ^ @pkgBin@: name of the binary to launch via 'cabal exec' + -> String -- ^ @envBin@: environment variable defining the binary to launch the process, when in Nix + -> [String] + -> m (ExitCode, String, String) -- ^ exit code, stdout, stderr +execFlexAny' :: forall (m :: * -> *). (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => ExecConfig -> [Char] -> [Char] -> [[Char]] -> m (ExitCode, [Char], [Char]) -execFlexAny' ExecConfig -execConfig [Char] -pkgBin [Char] -envBin [[Char]] -arguments = forall a. HasCallStack => (HasCallStack => a) -> a +execFlexAny' ExecConfig +execConfig [Char] +pkgBin [Char] +envBin [[Char]] +arguments = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - CreateProcess -cp <- forall (m :: * -> *). + CreateProcess +cp <- forall (m :: * -> *). (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => ExecConfig -> [Char] -> [Char] -> [[Char]] -> m CreateProcess procFlex' ExecConfig -execConfig [Char] -pkgBin [Char] -envBin [[Char]] -arguments - forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () +execConfig [Char] +pkgBin [Char] +envBin [[Char]] +arguments + forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () H.annotate forall b c a. (b -> c) -> (a -> b) -> a -> c . ([Char] "━━━━ command ━━━━\n" forall a. Semigroup a => a -> a -> a <>) forall a b. (a -> b) -> a -> b $ case CreateProcess -> CmdSpec IO.cmdspec CreateProcess -cp of - IO.ShellCommand [Char] -cmd -> [Char] -cmd - IO.RawCommand [Char] -cmd [[Char]] -args -> [Char] -cmd forall a. Semigroup a => a -> a -> a +cp of + IO.ShellCommand [Char] +cmd -> [Char] +cmd + IO.RawCommand [Char] +cmd [[Char]] +args -> [Char] +cmd forall a. Semigroup a => a -> a -> a <> [Char] " " forall a. Semigroup a => a -> a -> a <> [[Char]] -> [Char] L.unwords (ShowS argQuote forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> [[Char]] -args) - forall (m :: * -> *) a. +args) + forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ CreateProcess -> [Char] -> IO (ExitCode, [Char], [Char]) IO.readCreateProcessWithExitCode CreateProcess -cp [Char] +cp [Char] "" - --- | Execute a process, returning '()'. -exec_ - :: (MonadTest m, MonadIO m, HasCallStack) - => ExecConfig - -> String - -> [String] - -> m () -exec_ :: forall (m :: * -> *). + +-- | Execute a process, returning '()'. +exec_ + :: (MonadTest m, MonadIO m, HasCallStack) + => ExecConfig + -> String + -> [String] + -> m () +exec_ :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => ExecConfig -> [Char] -> [[Char]] -> m () -exec_ ExecConfig -execConfig [Char] -bin [[Char]] -arguments = forall (f :: * -> *) a. Functor f => f a -> f () +exec_ ExecConfig +execConfig [Char] +bin [[Char]] +arguments = forall (f :: * -> *) a. Functor f => f a -> f () void forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => ExecConfig -> [Char] -> [[Char]] -> m [Char] exec ExecConfig -execConfig [Char] -bin [[Char]] -arguments - --- | Execute a process, returning the stdout. Fail if the call returns --- with a non-zero exit code. For a version that doesn't fail upon receiving --- a non-zero exit code, see 'execAny'. -exec - :: (MonadTest m, MonadIO m, HasCallStack) - => ExecConfig - -> String - -> [String] - -> m String -exec :: forall (m :: * -> *). +execConfig [Char] +bin [[Char]] +arguments + +-- | Execute a process, returning the stdout. Fail if the call returns +-- with a non-zero exit code. For a version that doesn't fail upon receiving +-- a non-zero exit code, see 'execAny'. +exec + :: (MonadTest m, MonadIO m, HasCallStack) + => ExecConfig + -> String + -> [String] + -> m String +exec :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => ExecConfig -> [Char] -> [[Char]] -> m [Char] -exec ExecConfig -execConfig [Char] -bin [[Char]] -arguments = forall a. HasCallStack => (HasCallStack => a) -> a +exec ExecConfig +execConfig [Char] +bin [[Char]] +arguments = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - (ExitCode -exitResult, [Char] -stdout, [Char] -stderr) <- forall (m :: * -> *). + (ExitCode +exitResult, [Char] +stdout, [Char] +stderr) <- forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => ExecConfig -> [Char] -> [[Char]] -> m (ExitCode, [Char], [Char]) execAny ExecConfig -execConfig [Char] -bin [[Char]] -arguments - case ExitCode -exitResult of - IO.ExitFailure Int -exitCode -> forall (m :: * -> *) a. MonadTest m => CallStack -> [Char] -> m a +execConfig [Char] +bin [[Char]] +arguments + case ExitCode +exitResult of + IO.ExitFailure Int +exitCode -> forall (m :: * -> *) a. MonadTest m => CallStack -> [Char] -> m a H.failMessage HasCallStack => CallStack GHC.callStack forall b c a. (b -> c) -> (a -> b) -> a -> c . [[Char]] -> [Char] L.unlines forall a b. (a -> b) -> a -> b $ - [ [Char] + [ [Char] "Process exited with non-zero exit-code: " forall a. [a] -> [a] -> [a] ++ forall a. Show a => a -> [Char] show @Int Int -exitCode ] - forall a. [a] -> [a] -> [a] +exitCode ] + forall a. [a] -> [a] -> [a] ++ (if forall (t :: * -> *) a. Foldable t => t a -> Bool L.null [Char] -stdout then [] else [[Char] +stdout then [] else [[Char] "━━━━ stdout ━━━━" , [Char] -stdout]) - forall a. [a] -> [a] -> [a] +stdout]) + forall a. [a] -> [a] -> [a] ++ (if forall (t :: * -> *) a. Foldable t => t a -> Bool L.null [Char] -stderr then [] else [[Char] +stderr then [] else [[Char] "━━━━ stderr ━━━━" , [Char] -stderr]) - ExitCode +stderr]) + ExitCode IO.ExitSuccess -> forall (m :: * -> *) a. Monad m => a -> m a return [Char] -stdout - --- | Execute a process, returning the error code, the stdout, and the stderr. -execAny - :: (MonadTest m, MonadIO m, HasCallStack) - => ExecConfig - -> String -- ^ The binary to launch - -> [String] -- ^ The binary's arguments - -> m (ExitCode, String, String) -- ^ exit code, stdout, stderr -execAny :: forall (m :: * -> *). +stdout + +-- | Execute a process, returning the error code, the stdout, and the stderr. +execAny + :: (MonadTest m, MonadIO m, HasCallStack) + => ExecConfig + -> String -- ^ The binary to launch + -> [String] -- ^ The binary's arguments + -> m (ExitCode, String, String) -- ^ exit code, stdout, stderr +execAny :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => ExecConfig -> [Char] -> [[Char]] -> m (ExitCode, [Char], [Char]) -execAny ExecConfig -execConfig [Char] -bin [[Char]] -arguments = forall a. HasCallStack => (HasCallStack => a) -> a +execAny ExecConfig +execConfig [Char] +bin [[Char]] +arguments = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - let cp :: CreateProcess -cp = ([Char] -> [[Char]] -> CreateProcess + let cp :: CreateProcess +cp = ([Char] -> [[Char]] -> CreateProcess IO.proc [Char] -bin [[Char]] -arguments) - { env :: Maybe [([Char], [Char])] +bin [[Char]] +arguments) + { env :: Maybe [([Char], [Char])] IO.env = forall a. Last a -> Maybe a getLast forall a b. (a -> b) -> a -> b $ ExecConfig -> Last [([Char], [Char])] execConfigEnv ExecConfig -execConfig - , cwd :: Maybe [Char] +execConfig + , cwd :: Maybe [Char] IO.cwd = forall a. Last a -> Maybe a getLast forall a b. (a -> b) -> a -> b $ ExecConfig -> Last [Char] execConfigCwd ExecConfig -execConfig - } - forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () +execConfig + } + forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () H.annotate forall b c a. (b -> c) -> (a -> b) -> a -> c . ( [Char] "━━━━ command ━━━━\n" forall a. Semigroup a => a -> a -> a <>) forall a b. (a -> b) -> a -> b $ [Char] -bin forall a. Semigroup a => a -> a -> a +bin forall a. Semigroup a => a -> a -> a <> [Char] " " forall a. Semigroup a => a -> a -> a <> [[Char]] -> [Char] L.unwords (ShowS argQuote forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> [[Char]] -arguments) - forall (m :: * -> *) a. +arguments) + forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ CreateProcess -> [Char] -> IO (ExitCode, [Char], [Char]) IO.readCreateProcessWithExitCode CreateProcess -cp [Char] +cp [Char] "" - --- | Wait for process to exit. -waitForProcess - :: (MonadTest m, MonadIO m, HasCallStack) - => ProcessHandle - -> m ExitCode -waitForProcess :: forall (m :: * -> *). + +-- | Wait for process to exit. +waitForProcess + :: (MonadTest m, MonadIO m, HasCallStack) + => ProcessHandle + -> m ExitCode +waitForProcess :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => ProcessHandle -> m ExitCode -waitForProcess ProcessHandle -hProcess = forall a. HasCallStack => (HasCallStack => a) -> a +waitForProcess ProcessHandle +hProcess = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ - forall (m :: * -> *) a. + forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ ProcessHandle -> IO ExitCode IO.waitForProcess ProcessHandle -hProcess - --- | Wait for process to exit or return 'Nothing' if interrupted by an asynchronous exception. -maybeWaitForProcess - :: (MonadTest m, MonadIO m, HasCallStack) - => ProcessHandle - -> m (Maybe ExitCode) -maybeWaitForProcess :: forall (m :: * -> *). +hProcess + +-- | Wait for process to exit or return 'Nothing' if interrupted by an asynchronous exception. +maybeWaitForProcess + :: (MonadTest m, MonadIO m, HasCallStack) + => ProcessHandle + -> m (Maybe ExitCode) +maybeWaitForProcess :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => ProcessHandle -> m (Maybe ExitCode) -maybeWaitForProcess ProcessHandle -hProcess = forall a. HasCallStack => (HasCallStack => a) -> a +maybeWaitForProcess ProcessHandle +hProcess = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ - forall (m :: * -> *) a. + forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ ProcessHandle -> IO (Maybe ExitCode) IO.maybeWaitForProcess ProcessHandle -hProcess - --- | Wait a maximum of 'seconds' secons for process to exit. -waitSecondsForProcess - :: (MonadTest m, MonadIO m, HasCallStack) - => Int - -> ProcessHandle - -> m (Either TimedOut ExitCode) -waitSecondsForProcess :: forall (m :: * -> *). +hProcess + +-- | Wait a maximum of 'seconds' secons for process to exit. +waitSecondsForProcess + :: (MonadTest m, MonadIO m, HasCallStack) + => Int + -> ProcessHandle + -> m (Either TimedOut ExitCode) +waitSecondsForProcess :: forall (m :: * -> *). (MonadTest m, MonadIO m, HasCallStack) => Int -> ProcessHandle -> m (Either TimedOut ExitCode) -waitSecondsForProcess Int -seconds ProcessHandle -hProcess = forall a. HasCallStack => (HasCallStack => a) -> a +waitSecondsForProcess Int +seconds ProcessHandle +hProcess = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Either TimedOut (Maybe ExitCode) -result <- forall (m :: * -> *) a. + Either TimedOut (Maybe ExitCode) +result <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall a b. (a -> b) -> a -> b $ Int -> ProcessHandle -> IO (Either TimedOut (Maybe ExitCode)) IO.waitSecondsForProcess Int -seconds ProcessHandle -hProcess - case Either TimedOut (Maybe ExitCode) -result of - Left TimedOut +seconds ProcessHandle +hProcess + case Either TimedOut (Maybe ExitCode) +result of + Left TimedOut TimedOut -> do - forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () + forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () H.annotate [Char] "Timed out waiting for process to exit" - forall (m :: * -> *) a. Monad m => a -> m a + forall (m :: * -> *) a. Monad m => a -> m a return (forall a b. a -> Either a b Left TimedOut TimedOut) - Right Maybe ExitCode -maybeExitCode -> do - case Maybe ExitCode -maybeExitCode of - Maybe ExitCode + Right Maybe ExitCode +maybeExitCode -> do + case Maybe ExitCode +maybeExitCode of + Maybe ExitCode Nothing -> forall (m :: * -> *) a. MonadTest m => CallStack -> [Char] -> m a H.failMessage HasCallStack => CallStack GHC.callStack [Char] "No exit code for process" - Just ExitCode -exitCode -> do - forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () + Just ExitCode +exitCode -> do + forall (m :: * -> *). (MonadTest m, HasCallStack) => [Char] -> m () H.annotate forall a b. (a -> b) -> a -> b $ [Char] "Process exited " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> [Char] show ExitCode -exitCode - forall (m :: * -> *) a. Monad m => a -> m a +exitCode + forall (m :: * -> *) a. Monad m => a -> m a return (forall a b. b -> Either a b Right ExitCode -exitCode) - --- | Compute the path to the binary given a package name or an environment variable override. -binFlex - :: (MonadTest m, MonadIO m) - => String - -- ^ Package name - -> String - -- ^ Environment variable pointing to the binary to run - -> m FilePath - -- ^ Path to executable -binFlex :: forall (m :: * -> *). -(MonadTest m, MonadIO m) => +exitCode) + +-- | Compute the path to the binary given a package name or an environment variable override. +binFlex + :: (HasCallStack, MonadTest m, MonadIO m) + => String + -- ^ Package name + -> String + -- ^ Environment variable pointing to the binary to run + -> m FilePath + -- ^ Path to executable +binFlex :: forall (m :: * -> *). +(HasCallStack, MonadTest m, MonadIO m) => [Char] -> [Char] -> m [Char] -binFlex [Char] -pkg [Char] -binaryEnv = do - Maybe [Char] -maybeEnvBin <- forall (m :: * -> *) a. MonadIO m => IO a -> m a +binFlex [Char] +pkg [Char] +binaryEnv = do + Maybe [Char] +maybeEnvBin <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ [Char] -> IO (Maybe [Char]) IO.lookupEnv [Char] -binaryEnv - case Maybe [Char] -maybeEnvBin of - Just [Char] -envBin -> forall (m :: * -> *) a. Monad m => a -> m a +binaryEnv + case Maybe [Char] +maybeEnvBin of + Just [Char] +envBin -> forall (m :: * -> *) a. Monad m => a -> m a return [Char] -envBin - Maybe [Char] +envBin + Maybe [Char] Nothing -> forall (m :: * -> *). -(MonadTest m, MonadIO m) => +(HasCallStack, MonadTest m, MonadIO m) => [Char] -> m [Char] binDist [Char] -pkg - --- | Consult the "plan.json" generated by cabal to get the path to the executable corresponding. --- to a haskell package. It is assumed that the project has already been configured and the --- executable has been built. -binDist - :: (MonadTest m, MonadIO m) - => String - -- ^ Package name - -> m FilePath - -- ^ Path to executable -binDist :: forall (m :: * -> *). -(MonadTest m, MonadIO m) => +pkg + +-- | Consult the "plan.json" generated by cabal to get the path to the executable corresponding. +-- to a haskell package. It is assumed that the project has already been configured and the +-- executable has been built. +-- Throws an exception on failure. +binDist + :: (HasCallStack, MonadTest m, MonadIO m) + => String + -- ^ Package name + -> m FilePath + -- ^ Path to executable +binDist :: forall (m :: * -> *). +(HasCallStack, MonadTest m, MonadIO m) => [Char] -> m [Char] -binDist [Char] -pkg = do - ByteString -contents <- forall (m :: * -> *) a. +binDist [Char] +pkg = do + Bool +doesPlanExist <- forall (m :: * -> *) a. MonadIO m => IO a -> m a +liftIO forall a b. (a -> b) -> a -> b +$ [Char] -> IO Bool +IO.doesFileExist [Char] +planJsonFile + forall (f :: * -> *). Applicative f => Bool -> f () -> f () +unless Bool +doesPlanExist forall a b. (a -> b) -> a -> b +$ + forall a. HasCallStack => [Char] -> a +error forall a b. (a -> b) -> a -> b +$ [Char] +"Could not find plan.json in the path: " forall a. Semigroup a => a -> a -> a +<> [Char] +planJsonFile + ByteString +contents <- forall (m :: * -> *) a. (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a H.evalIO forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -757,90 +777,100 @@ LBS.readFile forall a b. (a -> b) -> a -> b $ [Char] planJsonFile - - case forall a. FromJSON a => ByteString -> Either [Char] a + + case forall a. FromJSON a => ByteString -> Either [Char] a eitherDecode ByteString -contents of - Right Plan -plan -> case forall a. (a -> Bool) -> [a] -> [a] +contents of + Right Plan +plan -> case forall a. (a -> Bool) -> [a] -> [a] L.filter Component -> Bool -matching (Plan -plan forall a b. a -> (a -> b) -> b +matching (Plan +plan forall a b. a -> (a -> b) -> b & Plan -> [Component] installPlan) of - (Component -component:[Component] + (Component +component:[Component] _) -> case Component -component forall a b. a -> (a -> b) -> b +component forall a b. a -> (a -> b) -> b & Component -> Maybe Text binFile of - Just Text -bin -> forall (m :: * -> *) a. Monad m => a -> m a + Just Text +bin -> forall (m :: * -> *) a. Monad m => a -> m a return forall a b. (a -> b) -> a -> b $ ShowS addExeSuffix (Text -> [Char] T.unpack Text -bin) - Maybe Text +bin) + Maybe Text Nothing -> forall a. HasCallStack => [Char] -> a error forall a b. (a -> b) -> a -> b $ [Char] -"missing bin-file in: " forall a. Semigroup a => a -> a -> a +"missing \"bin-file\" key in plan component: " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> [Char] show Component -component - [] -> forall a. HasCallStack => [Char] -> a +component forall a. Semigroup a => a -> a -> a +<> [Char] +" in the plan in: " forall a. Semigroup a => a -> a -> a +<> [Char] +planJsonFile + [] -> forall a. HasCallStack => [Char] -> a error forall a b. (a -> b) -> a -> b $ [Char] -"Cannot find exe:" forall a. Semigroup a => a -> a -> a +"Cannot find \"component-name\" key with the value \"exe:" forall a. Semigroup a => a -> a -> a +<> [Char] +pkg forall a. Semigroup a => a -> a -> a <> [Char] -pkg forall a. Semigroup a => a -> a -> a +"\" in the plan in: " forall a. Semigroup a => a -> a -> a <> [Char] -" in plan" - Left [Char] -message -> forall a. HasCallStack => [Char] -> a +planJsonFile + Left [Char] +message -> forall a. HasCallStack => [Char] -> a error forall a b. (a -> b) -> a -> b $ [Char] -"Cannot decode plan: " forall a. Semigroup a => a -> a -> a +"Cannot decode plan in " forall a. Semigroup a => a -> a -> a +<> [Char] +planJsonFile forall a. Semigroup a => a -> a -> a +<> [Char] +": " forall a. Semigroup a => a -> a -> a <> [Char] -message - where matching :: Component -> Bool - matching :: Component -> Bool -matching Component -component = case Component -> Maybe Text +message + where matching :: Component -> Bool + matching :: Component -> Bool +matching Component +component = case Component -> Maybe Text componentName Component -component of - Just Text -name -> Text -name forall a. Eq a => a -> a -> Bool +component of + Just Text +name -> Text +name forall a. Eq a => a -> a -> Bool == Text "exe:" forall a. Semigroup a => a -> a -> a <> [Char] -> Text T.pack [Char] -pkg - Maybe Text +pkg + Maybe Text Nothing -> Bool False - --- | Create a 'CreateProcess' describing how to start a process given the Cabal package name --- corresponding to the executable, an environment variable pointing to the executable, --- and an argument list. --- --- The actual executable used will the one specified by the environment variable, but if --- the environment variable is not defined, it will be found instead by consulting the --- "plan.json" generated by cabal. It is assumed that the project has already been --- configured and the executable has been built. -procFlex - :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) - => String - -- ^ Cabal package name corresponding to the executable - -> String - -- ^ Environment variable pointing to the binary to run - -> [String] - -- ^ Arguments to the CLI command - -> m CreateProcess - -- ^ Captured stdout -procFlex :: forall (m :: * -> *). + +-- | Create a 'CreateProcess' describing how to start a process given the Cabal package name +-- corresponding to the executable, an environment variable pointing to the executable, +-- and an argument list. +-- +-- The actual executable used will the one specified by the environment variable, but if +-- the environment variable is not defined, it will be found instead by consulting the +-- "plan.json" generated by cabal. It is assumed that the project has already been +-- configured and the executable has been built. +procFlex + :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) + => String + -- ^ Cabal package name corresponding to the executable + -> String + -- ^ Environment variable pointing to the binary to run + -> [String] + -- ^ Arguments to the CLI command + -> m CreateProcess + -- ^ Captured stdout +procFlex :: forall (m :: * -> *). (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => [Char] -> [Char] -> [[Char]] -> m CreateProcess procFlex = forall (m :: * -> *). @@ -848,123 +878,123 @@ ExecConfig -> [Char] -> [Char] -> [[Char]] -> m CreateProcess procFlex' ExecConfig defaultExecConfig - -procFlex' - :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) - => ExecConfig - -> String - -- ^ Cabal package name corresponding to the executable - -> String - -- ^ Environment variable pointing to the binary to run - -> [String] - -- ^ Arguments to the CLI command - -> m CreateProcess - -- ^ Captured stdout -procFlex' :: forall (m :: * -> *). + +procFlex' + :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) + => ExecConfig + -> String + -- ^ Cabal package name corresponding to the executable + -> String + -- ^ Environment variable pointing to the binary to run + -> [String] + -- ^ Arguments to the CLI command + -> m CreateProcess + -- ^ Captured stdout +procFlex' :: forall (m :: * -> *). (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) => ExecConfig -> [Char] -> [Char] -> [[Char]] -> m CreateProcess -procFlex' ExecConfig -execConfig [Char] -pkg [Char] -binaryEnv [[Char]] -arguments = forall a. HasCallStack => (HasCallStack => a) -> a +procFlex' ExecConfig +execConfig [Char] +pkg [Char] +binaryEnv [[Char]] +arguments = forall a. HasCallStack => (HasCallStack => a) -> a GHC.withFrozenCallStack forall b c a. (b -> c) -> (a -> b) -> a -> c . forall (m :: * -> *) a. (MonadTest m, MonadCatch m, HasCallStack) => m a -> m a H.evalM forall a b. (a -> b) -> a -> b $ do - [Char] -bin <- forall (m :: * -> *). -(MonadTest m, MonadIO m) => + [Char] +bin <- forall (m :: * -> *). +(HasCallStack, MonadTest m, MonadIO m) => [Char] -> [Char] -> m [Char] binFlex [Char] -pkg [Char] -binaryEnv - forall (m :: * -> *) a. Monad m => a -> m a +pkg [Char] +binaryEnv + forall (m :: * -> *) a. Monad m => a -> m a return ([Char] -> [[Char]] -> CreateProcess IO.proc [Char] -bin [[Char]] -arguments) - { env :: Maybe [([Char], [Char])] +bin [[Char]] +arguments) + { env :: Maybe [([Char], [Char])] IO.env = forall a. Last a -> Maybe a getLast forall a b. (a -> b) -> a -> b $ ExecConfig -> Last [([Char], [Char])] execConfigEnv ExecConfig -execConfig - , cwd :: Maybe [Char] +execConfig + , cwd :: Maybe [Char] IO.cwd = forall a. Last a -> Maybe a getLast forall a b. (a -> b) -> a -> b $ ExecConfig -> Last [Char] execConfigCwd ExecConfig -execConfig - -- this allows sending signals to the created processes, without killing the test-suite process - , create_group :: Bool +execConfig + -- this allows sending signals to the created processes, without killing the test-suite process + , create_group :: Bool IO.create_group = Bool True - } - --- | Compute the project base. This will be based on either the "CARDANO_NODE_SRC" --- environment variable or the first parent directory that contains the `cabal.project`. --- Both should point to the root directory of the Github project checkout. -getProjectBase - :: (MonadTest m, MonadIO m) - => m String -getProjectBase :: forall (m :: * -> *). (MonadTest m, MonadIO m) => m [Char] + } + +-- | Compute the project base. This will be based on either the "CARDANO_NODE_SRC" +-- environment variable or the first parent directory that contains the `cabal.project`. +-- Both should point to the root directory of the Github project checkout. +getProjectBase + :: (MonadTest m, MonadIO m) + => m String +getProjectBase :: forall (m :: * -> *). (MonadTest m, MonadIO m) => m [Char] getProjectBase = do - let - findUp :: [Char] -> m [Char] -findUp [Char] -dir = do - Bool -atBase <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + let + findUp :: [Char] -> m [Char] +findUp [Char] +dir = do + Bool +atBase <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ [Char] -> IO Bool IO.doesFileExist ([Char] -dir [Char] -> ShowS +dir [Char] -> ShowS </> [Char] "cabal.project") - if Bool -atBase - then forall (m :: * -> *) a. Monad m => a -> m a + if Bool +atBase + then forall (m :: * -> *) a. Monad m => a -> m a return [Char] -dir - else do - let up :: [Char] -up = [Char] -dir [Char] -> ShowS +dir + else do + let up :: [Char] +up = [Char] +dir [Char] -> ShowS </> [Char] ".." - Bool -upExist <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + Bool +upExist <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ [Char] -> IO Bool IO.doesDirectoryExist [Char] -up - if Bool -upExist - then [Char] -> m [Char] -findUp [Char] -up - else forall (m :: * -> *) a. MonadIO m => IO a -> m a +up + if Bool +upExist + then [Char] -> m [Char] +findUp [Char] +up + else forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ forall (m :: * -> *) a. MonadFail m => [Char] -> m a fail [Char] "Could not detect project base directory (containing cabal.project)" - Maybe [Char] -maybeNodeSrc <- forall (m :: * -> *) a. MonadIO m => IO a -> m a + Maybe [Char] +maybeNodeSrc <- forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ [Char] -> IO (Maybe [Char]) IO.lookupEnv [Char] "CARDANO_NODE_SRC" - case Maybe [Char] -maybeNodeSrc of - Just [Char] -path -> forall (m :: * -> *) a. Monad m => a -> m a + case Maybe [Char] +maybeNodeSrc of + Just [Char] +path -> forall (m :: * -> *) a. Monad m => a -> m a return [Char] -path - Maybe [Char] +path + Maybe [Char] Nothing -> forall {m :: * -> *}. MonadIO m => [Char] -> m [Char] -findUp [Char] +findUp [Char] "." - \ No newline at end of file + \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Test.TestWatchdog.html b/hedgehog-extras/src/Hedgehog.Extras.Test.TestWatchdog.html index 8ea485ad..c18c471c 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Test.TestWatchdog.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Test.TestWatchdog.html @@ -85,121 +85,121 @@ kickChan :: TChan WatchdogCommand -- ^ a queue of watchdog commands } -instance Show Watchdog where - show :: Watchdog -> String +instance Show Watchdog where + show :: Watchdog -> String show Watchdog{watchdogConfig :: Watchdog -> WatchdogConfig -watchdogConfig=WatchdogConfig{Int +watchdogConfig=WatchdogConfig{Int watchdogTimeout :: Int watchdogTimeout :: WatchdogConfig -> Int -watchdogTimeout}, UTCTime +watchdogTimeout}, UTCTime startTime :: UTCTime startTime :: Watchdog -> UTCTime -startTime, ThreadId +startTime, ThreadId watchedThreadId :: ThreadId watchedThreadId :: Watchdog -> ThreadId -watchedThreadId} = forall a. Monoid a => [a] -> a +watchedThreadId} = forall a. Monoid a => [a] -> a mconcat [ String "Watchdog with timeout ", forall a. Show a => a -> String show Int -watchdogTimeout +watchdogTimeout , String ", started at ", forall a. Show a => a -> String show UTCTime -startTime +startTime , String ", watching thread ID ", forall a. Show a => a -> String show ThreadId -watchedThreadId +watchedThreadId ] -- | Create manually a new watchdog, providing the target thread ID. After all watchdog timeouts expire, -- the target thread will get 'WatchdogException' thrown to it asynchronously (using 'throwTo'). -makeWatchdog :: MonadBase IO m +makeWatchdog :: MonadBase IO m => WatchdogConfig -> ThreadId -- ^ thread id which will get killed after all kicks expire - -> m Watchdog + -> m Watchdog makeWatchdog :: forall (m :: * -> *). MonadBase IO m => WatchdogConfig -> ThreadId -> m Watchdog -makeWatchdog WatchdogConfig -config ThreadId -watchedThreadId' = forall (b :: * -> *) (m :: * -> *) α. MonadBase b m => b α -> m α +makeWatchdog WatchdogConfig +config ThreadId +watchedThreadId' = forall (b :: * -> *) (m :: * -> *) α. MonadBase b m => b α -> m α liftBase forall a b. (a -> b) -> a -> b $ do - Watchdog -watchdog <- WatchdogConfig + Watchdog +watchdog <- WatchdogConfig -> ThreadId -> UTCTime -> TChan WatchdogCommand -> Watchdog Watchdog WatchdogConfig -config ThreadId -watchedThreadId' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +config ThreadId +watchedThreadId' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> IO UTCTime getCurrentTime forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> forall a. IO (TChan a) newTChanIO forall (m :: * -> *). MonadIO m => Watchdog -> m () kickWatchdog Watchdog -watchdog +watchdog forall (f :: * -> *) a. Applicative f => a -> f a pure Watchdog -watchdog +watchdog -- | Run watchdog in a loop in the current thread. Usually this function should be used with 'H.withAsync' -- to run it in the background. -runWatchdog :: MonadBase IO m +runWatchdog :: MonadBase IO m => Watchdog - -> m () + -> m () runWatchdog :: forall (m :: * -> *). MonadBase IO m => Watchdog -> m () -runWatchdog w :: Watchdog -w@Watchdog{ThreadId +runWatchdog w :: Watchdog +w@Watchdog{ThreadId watchedThreadId :: ThreadId watchedThreadId :: Watchdog -> ThreadId -watchedThreadId, UTCTime +watchedThreadId, UTCTime startTime :: UTCTime startTime :: Watchdog -> UTCTime -startTime, TChan WatchdogCommand +startTime, TChan WatchdogCommand kickChan :: TChan WatchdogCommand kickChan :: Watchdog -> TChan WatchdogCommand -kickChan} = forall (b :: * -> *) (m :: * -> *) α. MonadBase b m => b α -> m α +kickChan} = forall (b :: * -> *) (m :: * -> *) α. MonadBase b m => b α -> m α liftBase forall a b. (a -> b) -> a -> b $ do forall a. STM a -> IO a atomically (forall a. TChan a -> STM (Maybe a) tryReadTChan TChan WatchdogCommand -kickChan) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b +kickChan) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= \case Just WatchdogCommand PoisonPill -> -- deactivate watchdog forall (f :: * -> *) a. Applicative f => a -> f a pure () - Just (Kick Int -timeout) -> do + Just (Kick Int +timeout) -> do -- got a kick, wait for another period Int -> IO () threadDelay forall a b. (a -> b) -> a -> b $ Int -timeout forall a. Num a => a -> a -> a +timeout forall a. Num a => a -> a -> a * Int 1_000_000 forall (m :: * -> *). MonadBase IO m => Watchdog -> m () runWatchdog Watchdog -w +w Maybe WatchdogCommand Nothing -> do -- we are out of scheduled timeouts, kill the monitored thread - UTCTime -currentTime <- IO UTCTime + UTCTime +currentTime <- IO UTCTime getCurrentTime forall e. Exception e => ThreadId -> e -> IO () throwTo ThreadId -watchedThreadId forall b c a. (b -> c) -> (a -> b) -> a -> c +watchedThreadId forall b c a. (b -> c) -> (a -> b) -> a -> c . NominalDiffTime -> WatchdogException WatchdogException forall a b. (a -> b) -> a -> b $ UTCTime -> UTCTime -> NominalDiffTime diffUTCTime UTCTime -currentTime UTCTime -startTime +currentTime UTCTime +startTime -- | Watchdog command data WatchdogCommand @@ -208,104 +208,104 @@ -- | Enqueue a kick for the watchdog. It will extend the timeout by another one defined in the watchdog -- configuration. -kickWatchdog :: MonadIO m => Watchdog -> m () +kickWatchdog :: MonadIO m => Watchdog -> m () kickWatchdog :: forall (m :: * -> *). MonadIO m => Watchdog -> m () kickWatchdog Watchdog{watchdogConfig :: Watchdog -> WatchdogConfig -watchdogConfig=WatchdogConfig{Int +watchdogConfig=WatchdogConfig{Int watchdogTimeout :: Int watchdogTimeout :: WatchdogConfig -> Int -watchdogTimeout}, TChan WatchdogCommand +watchdogTimeout}, TChan WatchdogCommand kickChan :: TChan WatchdogCommand kickChan :: Watchdog -> TChan WatchdogCommand -kickChan} = forall (m :: * -> *) a. MonadIO m => IO a -> m a +kickChan} = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ forall a. STM a -> IO a atomically forall a b. (a -> b) -> a -> b $ forall a. TChan a -> a -> STM () writeTChan TChan WatchdogCommand -kickChan (Int -> WatchdogCommand +kickChan (Int -> WatchdogCommand Kick Int -watchdogTimeout) +watchdogTimeout) -- | Enqueue a poison pill for the watchdog. It will stop the watchdog after all timeouts. -poisonWatchdog :: MonadIO m => Watchdog -> m () +poisonWatchdog :: MonadIO m => Watchdog -> m () poisonWatchdog :: forall (m :: * -> *). MonadIO m => Watchdog -> m () -poisonWatchdog Watchdog{TChan WatchdogCommand +poisonWatchdog Watchdog{TChan WatchdogCommand kickChan :: TChan WatchdogCommand kickChan :: Watchdog -> TChan WatchdogCommand -kickChan} = forall (m :: * -> *) a. MonadIO m => IO a -> m a +kickChan} = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ forall a. STM a -> IO a atomically forall a b. (a -> b) -> a -> b $ forall a. TChan a -> a -> STM () writeTChan TChan WatchdogCommand -kickChan WatchdogCommand +kickChan WatchdogCommand PoisonPill -- | Execute a test case with a watchdog. -runWithWatchdog :: HasCallStack - => MonadBaseControl IO m +runWithWatchdog :: HasCallStack + => MonadBaseControl IO m => WatchdogConfig -- ^ configuration - -> (HasCallStack => Watchdog -> m a) -- ^ a test case to be wrapped in watchdog - -> m a + -> (HasCallStack => Watchdog -> m a) -- ^ a test case to be wrapped in watchdog + -> m a runWithWatchdog :: forall (m :: * -> *) a. (HasCallStack, MonadBaseControl IO m) => WatchdogConfig -> (HasCallStack => Watchdog -> m a) -> m a -runWithWatchdog WatchdogConfig -config HasCallStack => Watchdog -> m a -testCase = do - ThreadId -watchedThreadId <- forall (b :: * -> *) (m :: * -> *) α. MonadBase b m => b α -> m α +runWithWatchdog WatchdogConfig +config HasCallStack => Watchdog -> m a +testCase = do + ThreadId +watchedThreadId <- forall (b :: * -> *) (m :: * -> *) α. MonadBase b m => b α -> m α liftBase IO ThreadId myThreadId - Watchdog -watchdog <- forall (b :: * -> *) (m :: * -> *) α. MonadBase b m => b α -> m α + Watchdog +watchdog <- forall (b :: * -> *) (m :: * -> *) α. MonadBase b m => b α -> m α liftBase forall a b. (a -> b) -> a -> b $ forall (m :: * -> *). MonadBase IO m => WatchdogConfig -> ThreadId -> m Watchdog makeWatchdog WatchdogConfig -config ThreadId -watchedThreadId +config ThreadId +watchedThreadId forall (m :: * -> *) a b. MonadBaseControl IO m => m a -> (Async (StM m a) -> m b) -> m b H.withAsync (forall (m :: * -> *). MonadBase IO m => Watchdog -> m () runWatchdog Watchdog -watchdog) forall a b. (a -> b) -> a -> b +watchdog) forall a b. (a -> b) -> a -> b $ \Async (StM m ()) _ -> HasCallStack => Watchdog -> m a -testCase Watchdog -watchdog +testCase Watchdog +watchdog -- | Execute a test case with a watchdog. -runWithWatchdog_ :: HasCallStack - => MonadBaseControl IO m +runWithWatchdog_ :: HasCallStack + => MonadBaseControl IO m => WatchdogConfig -- ^ configuration - -> (HasCallStack => m a) -- ^ a test case to be wrapped in watchdog - -> m a + -> (HasCallStack => m a) -- ^ a test case to be wrapped in watchdog + -> m a runWithWatchdog_ :: forall (m :: * -> *) a. (HasCallStack, MonadBaseControl IO m) => WatchdogConfig -> (HasCallStack => m a) -> m a -runWithWatchdog_ WatchdogConfig -config HasCallStack => m a -testCase = forall (m :: * -> *) a. +runWithWatchdog_ WatchdogConfig +config HasCallStack => m a +testCase = forall (m :: * -> *) a. (HasCallStack, MonadBaseControl IO m) => WatchdogConfig -> (HasCallStack => Watchdog -> m a) -> m a runWithWatchdog WatchdogConfig -config (forall a b. a -> b -> a +config (forall a b. a -> b -> a const HasCallStack => m a -testCase) +testCase) -- | Execute a test case with watchdog with default config. -runWithDefaultWatchdog :: HasCallStack - => MonadBaseControl IO m - => (HasCallStack => Watchdog -> m a) -- ^ a test case to be wrapped in watchdog - -> m a +runWithDefaultWatchdog :: HasCallStack + => MonadBaseControl IO m + => (HasCallStack => Watchdog -> m a) -- ^ a test case to be wrapped in watchdog + -> m a runWithDefaultWatchdog :: forall (m :: * -> *) a. (HasCallStack, MonadBaseControl IO m) => (HasCallStack => Watchdog -> m a) -> m a @@ -316,31 +316,31 @@ defaultWatchdogConfig -- | Execute a test case with watchdog with default config. -runWithDefaultWatchdog_ :: HasCallStack - => MonadBaseControl IO m - => (HasCallStack => m a) -- ^ a test case to be wrapped in watchdog - -> m a +runWithDefaultWatchdog_ :: HasCallStack + => MonadBaseControl IO m + => (HasCallStack => m a) -- ^ a test case to be wrapped in watchdog + -> m a runWithDefaultWatchdog_ :: forall (m :: * -> *) a. (HasCallStack, MonadBaseControl IO m) => (HasCallStack => m a) -> m a -runWithDefaultWatchdog_ HasCallStack => m a -testCase = forall (m :: * -> *) a. +runWithDefaultWatchdog_ HasCallStack => m a +testCase = forall (m :: * -> *) a. (HasCallStack, MonadBaseControl IO m) => (HasCallStack => Watchdog -> m a) -> m a runWithDefaultWatchdog (forall a b. a -> b -> a const HasCallStack => m a -testCase) +testCase) -- | An exception thrown to the test case thread. newtype WatchdogException = WatchdogException { WatchdogException -> NominalDiffTime timeElapsed :: NominalDiffTime } -instance Show WatchdogException where - show :: WatchdogException -> String -show WatchdogException{NominalDiffTime +instance Show WatchdogException where + show :: WatchdogException -> String +show WatchdogException{NominalDiffTime timeElapsed :: NominalDiffTime timeElapsed :: WatchdogException -> NominalDiffTime -timeElapsed} = +timeElapsed} = String "WatchdogException: Test watchdog killed test case thread after " forall a. Semigroup a => a -> a -> a <> forall a. Show a => a -> String @@ -348,9 +348,9 @@ round forall a b. (a -> b) -> a -> b $ NominalDiffTime -> Pico nominalDiffTimeToSeconds NominalDiffTime -timeElapsed) forall a. Semigroup a => a -> a -> a +timeElapsed) forall a. Semigroup a => a -> a -> a <> String " seconds." -instance Exception WatchdogException +instance Exception WatchdogException \ No newline at end of file diff --git a/hedgehog-extras/src/Hedgehog.Extras.Test.Tripwire.html b/hedgehog-extras/src/Hedgehog.Extras.Test.Tripwire.html index a4fe3db3..fe6ace4d 100644 --- a/hedgehog-extras/src/Hedgehog.Extras.Test.Tripwire.html +++ b/hedgehog-extras/src/Hedgehog.Extras.Test.Tripwire.html @@ -54,24 +54,24 @@ tripSite :: MVar CallStack -- ^ call stack of the trip site } -instance Show Tripwire where - show :: Tripwire -> String -show Tripwire{String +instance Show Tripwire where + show :: Tripwire -> String +show Tripwire{String tripwireId :: String tripwireId :: Tripwire -> String -tripwireId} = String +tripwireId} = String "Tripwire " forall a. Semigroup a => a -> a -> a <> String -tripwireId +tripwireId -- | Creates a new tripwire -makeTripwire :: MonadIO m => m Tripwire +makeTripwire :: MonadIO m => m Tripwire makeTripwire :: forall (m :: * -> *). MonadIO m => m Tripwire makeTripwire = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do - Int -id' <- forall a b. IORef a -> (a -> (a, b)) -> IO b + Int +id' <- forall a b. IORef a -> (a -> (a, b)) -> IO b atomicModifyIORef' IORef Int tripwireCounter (forall (m :: * -> *) a. Monad m => m (m a) -> m a join (,) forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -81,47 +81,47 @@ String -> MVar CallStack -> Tripwire Tripwire (forall a. Show a => a -> String show Int -id') forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +id') forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. IO (MVar a) newEmptyMVar -- | Creates a new tripwire with a label, which is visible when 'show'ed: @Tripwire mylabel@ -makeTripwireWithLabel :: MonadIO m +makeTripwireWithLabel :: MonadIO m => String - -> m Tripwire + -> m Tripwire makeTripwireWithLabel :: forall (m :: * -> *). MonadIO m => String -> m Tripwire -makeTripwireWithLabel String -label = forall (m :: * -> *) a. MonadIO m => IO a -> m a +makeTripwireWithLabel String +label = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do String -> MVar CallStack -> Tripwire Tripwire String -label forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b +label forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. IO (MVar a) newEmptyMVar -- | Triggers the tripwire and registers the place of the first trigger. Idempotent. -- Prints the information in the test log about tripping the tripwire. -trip :: HasCallStack - => MonadIO m - => MonadTest m +trip :: HasCallStack + => MonadIO m + => MonadTest m => Tripwire - -> m () + -> m () trip :: forall (m :: * -> *). (HasCallStack, MonadIO m, MonadTest m) => Tripwire -> m () -trip t :: Tripwire -t@Tripwire{MVar CallStack +trip t :: Tripwire +t@Tripwire{MVar CallStack tripSite :: MVar CallStack tripSite :: Tripwire -> MVar CallStack -tripSite} = forall a. HasCallStack => (HasCallStack => a) -> a +tripSite} = forall a. HasCallStack => (HasCallStack => a) -> a withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () H.note_ forall a b. (a -> b) -> a -> b $ forall a. Show a => a -> String show Tripwire -t forall a. Semigroup a => a -> a -> a +t forall a. Semigroup a => a -> a -> a <> String " has been tripped" forall (f :: * -> *) a. Functor f => f a -> f () @@ -130,20 +130,20 @@ liftIO forall a b. (a -> b) -> a -> b $ forall a. MVar a -> a -> IO Bool tryPutMVar MVar CallStack -tripSite HasCallStack => CallStack +tripSite HasCallStack => CallStack callStack -- | Triggers the tripwire and registers the place of the first trigger. Idempotent. A silent variant of -- 'trip' which does not require 'MonadTest', but also does not log the information about tripping. -trip_ :: HasCallStack - => MonadIO m +trip_ :: HasCallStack + => MonadIO m => Tripwire - -> m () + -> m () trip_ :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Tripwire -> m () -trip_ Tripwire{MVar CallStack +trip_ Tripwire{MVar CallStack tripSite :: MVar CallStack tripSite :: Tripwire -> MVar CallStack -tripSite} = forall a. HasCallStack => (HasCallStack => a) -> a +tripSite} = forall a. HasCallStack => (HasCallStack => a) -> a withFrozenCallStack forall a b. (a -> b) -> a -> b $ do forall (f :: * -> *) a. Functor f => f a -> f () @@ -152,119 +152,119 @@ liftIO forall a b. (a -> b) -> a -> b $ forall a. MVar a -> a -> IO Bool tryPutMVar MVar CallStack -tripSite HasCallStack => CallStack +tripSite HasCallStack => CallStack callStack -- | Restore tripwire to initial non triggered state -resetTripwire :: MonadIO m +resetTripwire :: MonadIO m => Tripwire - -> m () + -> m () resetTripwire :: forall (m :: * -> *). MonadIO m => Tripwire -> m () -resetTripwire Tripwire{MVar CallStack +resetTripwire Tripwire{MVar CallStack tripSite :: MVar CallStack tripSite :: Tripwire -> MVar CallStack -tripSite} = forall (m :: * -> *) a. MonadIO m => IO a -> m a +tripSite} = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ forall (f :: * -> *) a. Functor f => f a -> f () void forall a b. (a -> b) -> a -> b $ forall a. MVar a -> IO (Maybe a) tryTakeMVar MVar CallStack -tripSite +tripSite -- | Return the call stack, where the tripwire was tripped - if it was tripped. -getTripSite :: MonadIO m +getTripSite :: MonadIO m => Tripwire - -> m (Maybe CallStack) + -> m (Maybe CallStack) getTripSite :: forall (m :: * -> *). MonadIO m => Tripwire -> m (Maybe CallStack) -getTripSite Tripwire{MVar CallStack +getTripSite Tripwire{MVar CallStack tripSite :: MVar CallStack tripSite :: Tripwire -> MVar CallStack -tripSite} = forall (m :: * -> *) a. MonadIO m => IO a -> m a +tripSite} = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ forall a. MVar a -> IO (Maybe a) tryReadMVar MVar CallStack -tripSite +tripSite -- | Check if the tripwire was tripped. -isTripped :: MonadIO m +isTripped :: MonadIO m => Tripwire - -> m Bool + -> m Bool isTripped :: forall (m :: * -> *). MonadIO m => Tripwire -> m Bool -isTripped Tripwire{MVar CallStack +isTripped Tripwire{MVar CallStack tripSite :: MVar CallStack tripSite :: Tripwire -> MVar CallStack -tripSite} = forall (m :: * -> *) a. MonadIO m => IO a -> m a +tripSite} = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ Bool -> Bool not forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> forall a. MVar a -> IO Bool isEmptyMVar MVar CallStack -tripSite +tripSite -- | Fails the test if the tripwire was triggered. Prints the call stack where the tripwire was triggered. -assertNotTripped :: HasCallStack - => MonadTest m - => MonadIO m +assertNotTripped :: HasCallStack + => MonadTest m + => MonadIO m => Tripwire - -> m () + -> m () assertNotTripped :: forall (m :: * -> *). (HasCallStack, MonadTest m, MonadIO m) => Tripwire -> m () -assertNotTripped Tripwire -tripwire = forall a. HasCallStack => (HasCallStack => a) -> a +assertNotTripped Tripwire +tripwire = forall a. HasCallStack => (HasCallStack => a) -> a withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Maybe CallStack -mTripSite <- forall (m :: * -> *). MonadIO m => Tripwire -> m (Maybe CallStack) + Maybe CallStack +mTripSite <- forall (m :: * -> *). MonadIO m => Tripwire -> m (Maybe CallStack) getTripSite Tripwire -tripwire +tripwire forall (t :: * -> *) (m :: * -> *) a b. (Foldable t, Monad m) => t a -> (a -> m b) -> m () forM_ Maybe CallStack -mTripSite forall a b. (a -> b) -> a -> b -$ \CallStack -cs -> do +mTripSite forall a b. (a -> b) -> a -> b +$ \CallStack +cs -> do forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () H.note_ forall a b. (a -> b) -> a -> b $ forall a. Show a => a -> String show Tripwire -tripwire forall a. Semigroup a => a -> a -> a +tripwire forall a. Semigroup a => a -> a -> a <> String " has been tripped at: " forall a. Semigroup a => a -> a -> a <> CallStack -> String prettyCallStack CallStack -cs +cs forall (m :: * -> *) a. (MonadTest m, HasCallStack) => m a H.failure -- | Fails the test if the tripwire was not triggered yet. -assertTripped :: HasCallStack - => MonadTest m - => MonadIO m +assertTripped :: HasCallStack + => MonadTest m + => MonadIO m => Tripwire - -> m () + -> m () assertTripped :: forall (m :: * -> *). (HasCallStack, MonadTest m, MonadIO m) => Tripwire -> m () -assertTripped Tripwire -tripwire = forall a. HasCallStack => (HasCallStack => a) -> a +assertTripped Tripwire +tripwire = forall a. HasCallStack => (HasCallStack => a) -> a withFrozenCallStack forall a b. (a -> b) -> a -> b $ do - Maybe CallStack -mTripSite <- forall (m :: * -> *). MonadIO m => Tripwire -> m (Maybe CallStack) + Maybe CallStack +mTripSite <- forall (m :: * -> *). MonadIO m => Tripwire -> m (Maybe CallStack) getTripSite Tripwire -tripwire +tripwire forall (f :: * -> *). Applicative f => Bool -> f () -> f () when (forall a. Maybe a -> Bool isNothing Maybe CallStack -mTripSite) forall a b. (a -> b) -> a -> b +mTripSite) forall a b. (a -> b) -> a -> b $ do forall (m :: * -> *). (MonadTest m, HasCallStack) => String -> m () H.note_ forall a b. (a -> b) -> a -> b $ forall a. Show a => a -> String show Tripwire -tripwire forall a. Semigroup a => a -> a -> a +tripwire forall a. Semigroup a => a -> a -> a <> String " was not tripped" forall (m :: * -> *) a. (MonadTest m, HasCallStack) => m a