Wiki

Clone wiki

hstest / FAQ

FAQ

If your question is not in this list, please e-mail me at beakerchu@googlemail.com.

hstest crashes when I try to check QuickCheck properties, how do I get it to work? My HUnit tests run fine

Version 0.0.2 of hstest only supports version 1 of QuickCheck, and your GHC install is using version 2 of QuickCheck by default.

To check this, run

$ ghc-pkg list QuickCheck

This will show you which version(s) of QuickCheck you have installed. For example, on my laptop this produces

/var/lib/ghc-6.12.1/package.conf.d
   QuickCheck-1.2.0.0
   QuickCheck-2.1.0.3

To prevent hstest from trying to use the later version, you use the --hide-package switch, e.g.

$ hstest --hide-package QuickCheck-2.1.0.3

The earlier version of QuickCheck may be hidden by default (in which case it will appear in brackets or a different colour in ghc-pkg's output). If so, you use the --expose-package switch to unhide it, e.g.

$ hstest --hide-package QuickCheck-2.1.0.3 --expose-package QuickCheck-1.2.0.0

If you do not have a version 1 of QuickCheck installed, I think you install it with

$ cabal install QuickCheck-1.2.0.0

Support for QuickCheck 2 is on my hstest todo list. Ideally hstest should just use and work with whichever version of QuickCheck it's given, but I haven't written enough code to make that happen yet.

Updated