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.Def.Golden

  • 1 type
  • 13 values
  • Packagesydtest-0.22.0.0
  • Exports14
  • LanguageHaskell2010
  • LicenceLicenseRef-OtherLicense
  • SourceGolden.hs

The golden test context for adding context to a golden test assertion:

goldenTestCompare = \actual expected ->
  if actual == expected
    then Nothing
    else Just $ Context (stringsNotEqualButShouldHaveBeenEqual actual expected) (goldenContext fp)
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