> 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

test-framework

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

Hspec

    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.

Cheers,
Simon

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to