[Haskell-cafe] ANNOUNCE: test-framework-golden-1.1

Simon Hengel sol at typeful.net
Fri Oct 5 13:43:57 CEST 2012

> 1. It's hard to guess at the moment how a good interface to the "pure
>    golden" part should look like.

Maybe just produce HUnit assertions, e.g.:

    goldenVsFile :: FilePath -> FilePath -> IO () -> Assertion

That way it works with plain HUnit

    main = runTestTT $ TestLabel "someAction produce desired output $
      goldenVsFile "ref.txt" "out.txt" someAction


    main = defaultMain [
        testGroup "someAction" [
          testCase "produces some desired output" $
            goldenVsFile "ref.txt" "out.txt" someAction


    main = hspec $ do
      describe "someAction" $ do
        it "produces some desired output" $ do
          goldenVsFile "ref.txt" "out.txt" someAction

and probably every other current or future Haskell test framework.


More information about the Haskell-Cafe mailing list