[Haskell-cafe] packages and QuickCheck

Sean Leather leather at cs.uu.nl
Tue Sep 9 09:46:38 EDT 2008

> How do folks like to package up QuickCheck tests for their libraries?  In
> the main library?  As a separate repo & package?  Same repo & separate
> package?  Keeping tests with the tested code allows testing of non-exported
> functionality, but can add quite a lot of clutter.

I have QuickCheck properties plus HUnit tests, but I think the question is
the same. For me, it's in the same repository and shipped with the package
source. I think that if you ship source (even via Hackage), you should also
ship tests. So, if somebody wants to modify the source, they can run the
tests. And making it convenient to test is very important, so I have "cabal
test" (or "runhaskell Setup.hs test" without cabal-install) configured to
run the tests. I don't think tests should (in general) be part of the
user-visible API, so I have them external to the module hierarchy.

Testing non-exported functionality without exporting the test interface
seems difficult in general. Is there a way to hide part of a module
interface with Cabal? Then, you could have a 'test' function exported from
each module for testing but hidden for release.

My current leaning is to split a package "foo" into packages "foo" and
> "foo-test"

What benefit does this provide?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080909/dd2fee85/attachment.htm

More information about the Haskell-Cafe mailing list