HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulesydtest-0.22.0.0Haskell2010

Test.Syd.Run

This module defines the IsTest class and the different instances for it.

  • 13 types
  • 1 class
  • 22 values
  • Packagesydtest-0.22.0.0
  • Exports36
  • LanguageHaskell2010
  • LicenceLicenseRef-OtherLicense
  • SourceRun.hs
classclass IsTest e where
#

Associated types

  • type family Arg1 e

    The argument from aroundAll

  • type family Arg2 e

    The argument from around

Methods

Instances20IsTest, …
  • IsTest PropertyDefined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest BoolDefined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (IO (GoldenTest a))Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (IO ())Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (GoldenTest a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (StagedGolden a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (arg -> Property)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (arg -> Bool)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (arg -> IO (GoldenTest a))Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (arg -> IO ())Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (arg -> GoldenTest a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (arg -> StagedGolden a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (outerArgs -> ReaderT env IO ())Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (outerArgs -> innerArg -> Property)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (outerArgs -> innerArg -> Bool)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (outerArgs -> innerArg -> IO (GoldenTest a))Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (outerArgs -> innerArg -> IO ())Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (outerArgs -> innerArg -> GoldenTest a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (outerArgs -> innerArg -> StagedGolden a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (ReaderT env IO ())Defined in sydtest-0.22.0.0 · Test.Syd.Run
valuearoundProp :: ((a -> b -> IO ()) -> IO ()) -> (a -> b -> Prop) -> Prop
#
valuearoundRose
  1. :: (a -> b -> IO ()) -> IO ()
  2. -> a -> b -> Rose Result
  3. -> Rose Result
#
datadata GoldenTest a
#

A golden test for output of type a.

The purpose of a golden test is to ensure that the output of a certain process does not change even over time.

Golden tests can also be used to show how the output of a certain process changes over time and force code reviewers to review the diff that they see in the PR.

This works by saving a golden output in the repository somewhere, committing it, and then compare that golden output to the output that is currently being produced. You can use `--golden-reset` to have sydtest update the golden output by writing the current output.

Constructors

Instances18IsTest, Arg1, Arg2, …
  • IsTest (IO (GoldenTest a))Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (GoldenTest a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (arg -> IO (GoldenTest a))Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (arg -> GoldenTest a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (outerArgs -> innerArg -> IO (GoldenTest a))Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (outerArgs -> innerArg -> GoldenTest a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg1 (IO (GoldenTest a)) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg1 (GoldenTest a) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg1 (arg -> IO (GoldenTest a)) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg1 (arg -> GoldenTest a) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg1 (outerArgs -> innerArg -> IO (GoldenTest a)) = outerArgsDefined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg1 (outerArgs -> innerArg -> GoldenTest a) = outerArgsDefined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg2 (IO (GoldenTest a)) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg2 (GoldenTest a) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg2 (arg -> IO (GoldenTest a)) = argDefined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg2 (arg -> GoldenTest a) = argDefined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg2 (outerArgs -> innerArg -> IO (GoldenTest a)) = innerArgDefined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg2 (outerArgs -> innerArg -> GoldenTest a) = innerArgDefined in sydtest-0.22.0.0 · Test.Syd.Run
newtypenewtype StagedGolden a
#

Constructors

Instances9IsTest, Arg1, Arg2, …
  • IsTest (StagedGolden a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (arg -> StagedGolden a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • IsTest (outerArgs -> innerArg -> StagedGolden a)Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg1 (StagedGolden a) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg1 (arg -> StagedGolden a) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg1 (outerArgs -> innerArg -> StagedGolden a) = outerArgsDefined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg2 (StagedGolden a) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg2 (arg -> StagedGolden a) = argDefined in sydtest-0.22.0.0 · Test.Syd.Run
  • type Arg2 (outerArgs -> innerArg -> StagedGolden a) = innerArgDefined in sydtest-0.22.0.0 · Test.Syd.Run
datadata TestRunSettings
#
Instances4Eq, Show, Generic, Rep
datadata SeedSetting
#
Instances6Eq, Show, Generic, HasCodec, HasParser, Rep
datadata TestRunResult
#
Instances3Show, Generic, Rep
datadata TestStatus
#
Instances4Eq, Show, Generic, Rep
datadata Assertion
#

A special exception that sydtest knows about and can display nicely in the error output

This is exported outwards so that you can define golden tests for custom types.

You will probably not want to use this directly in everyday tests, use shouldBe or a similar function instead.

Constructors

Instances5Eq, Show, Generic, Exception, Rep
valuecomputeDiff :: String -> String -> [Diff Text]
#

Returns the diff between two strings

Be careful, this function runtime is not bounded and it can take a lot of time (hours) if the input strings are complex. This is exposed for reference, but you may want to use mkNotEqualButShouldHaveBeenEqual which ensures that diff computation timeouts.

datadata Contextual
#

An exception with context.

We wrap an existentially qualified exception here, instead of SomeException, so that we can unwrap it. (For some unknown reason, that doesn't work otherwise.)

Constructors

Instances2Show, Exception
datadata GoldenCase
#
Instances4Eq, Show, Generic, Rep
datadata Progress
#
Instances4Eq, Show, Generic, Rep
valuetimeItT :: MonadIO m => Int -> m a -> m (Timed a)
#

Time an action and return the result as well as how long it took in seconds.

This function does not use the timeit package because that package uses CPU time instead of system time. That means that any waiting, like with threadDelay would not be counted.

Note that this does not evaluate the result, on purpose.

datadata Timed a
#

Constructors

Instances5Functor, Eq, Show, Generic, Rep