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

Moduletasty-silver-3.3.2.1Haskell2010

Test.Tasty.Silver.Advanced

  • 2 types
  • 5 values

Constructing golden tests

6 declarations
valuegoldenTest1
  1. :: TestName

    test name

  2. -> IO (Maybe a)

    get the golden correct value

  3. -> IO a

    get the tested value

  4. -> (a -> a -> GDiff)

    comparison function.

    If two values are the same, it should return Equal. If they are different, it should return a diff representation. First argument is golden value.

  5. -> (a -> GShow)

    Show the golden/actual value.

  6. -> (a -> IO ())

    update the golden file

  7. -> TestTree
#

A very general testing function.

valuegoldenTestIO
  1. :: TestName

    test name

  2. -> IO (Maybe a)

    get the golden correct value

  3. -> IO a

    get the tested value

  4. -> (a -> a -> IO GDiff)

    comparison function.

    If two values are the same, it should return Equal. If they are different, it should return a diff representation. First argument is golden value.

  5. -> (a -> IO GShow)

    Show the golden/actual value.

  6. -> (a -> IO ())

    update the golden file

  7. -> TestTree
#

A very general testing function. The IO version of show/diff are useful when using external diff or show mechanisms. If IO is not required, the goldenTest1 function should be used instead.

valuegoldenTestIO1
  1. :: TestName

    test name

  2. -> IO (Maybe a)

    get the golden correct value

  3. -> IO a

    get the tested value

  4. -> (a -> a -> IO GDiff)

    comparison function.

    If two values are the same, it should return Equal. If they are different, it should return a diff representation. First argument is golden value.

  5. -> (a -> IO GShow)

    Show the golden/actual value.

  6. -> Maybe (a -> IO ())

    update the golden file

  7. -> TestTree
#

A very general testing function. Experimental function, may change in later versions! The IO version of show/diff are useful when using external diff or show mechanisms. If IO is not required, the goldenTest1 function should be used instead.

valuegoldenTest
  1. :: TestName

    test name

  2. -> IO a

    get the golden correct value

  3. -> IO a

    get the tested value

  4. -> (a -> a -> IO (Maybe String))

    comparison function.

    If two values are the same, it should return Nothing. If they are different, it should return an error that will be printed to the user. First argument is the golden value.

    The function may use IO, for example, to launch an external diff command.

  5. -> (a -> IO ())

    update the golden file

  6. -> TestTree
#

A very general testing function. Use goldenTest1 instead if you can.

datadata GShow
#

How to show a value to the user.

Constructors

Reading files

1 declaration