[Haskell-cafe] Observations from ListLike

Ketil Malde ketil at ii.uib.no
Tue Sep 18 02:49:45 EDT 2007


On Mon, 2007-09-17 at 14:37 -0500, John Goerzen wrote:

> * It would be really nice if QuickCheck supported I/O and some version
>   of HUnit's TestLabel to generate hierarchical names when failures
>   occur.

I've done this for testing IO (reading and writing files):

> prop_serialize (E s) = 
>    let [s'] = unsafePerformIO (do writeFasta "/tmp/serialize_test" [s]
>                                   readFasta "/tmp/serialize_test")
>    in s == s'

I'm not sure if this is kosher, but at least the tests pass :-)

I (like everybody else?)'ve written a small driver for the tests, but
perhaps I should look at HUnit for a more general framework?

-k



More information about the Haskell-Cafe mailing list