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

Simon Hengel sol at typeful.net
Sun Oct 7 15:45:21 CEST 2012


On Fri, Oct 05, 2012 at 05:17:18PM +0300, Roman Cheplyaka wrote:
> I can do that indeed, and I guess I could reimplement everything I have
> at the moment on top of HUnit.
> 
> However, an important part of functionality isn't there at the moment —
> golden file management. You should be able to say, "for this test,
> take its current output and write it to the corresponding golden file".
> 
> In order to do that, you need to have access to the list of golden tests
> in the suite. This is where implementation details of different test
> frameworks start to matter. Probably one can make an abstraction over
> test frameworks that would give the list of all golden tests.
> (Although when you start abstracting over test frameworks, which are
> abstractions themselves, it becomes somewhat funny.)

Ok, makes sense.

I'm looking forward to give it a try, and see how it compares to using
operating system primitives (say `cp') for "golden file management".

> Speaking of such functionality, correct me if I'm wrong, but neither
> HUnit nor hspec won't be able to support it anyway, because they
> represent tests as opaque IO actions.

It would be easy to extend Hspec to support this in the same way you
extend test-framework to support this.  It requires existentials;  the
only substantial difference that I can see is that test-framework
already uses existentials, while Hspec does not.

Cheers,
Simon



More information about the Haskell-Cafe mailing list