batterseapower / test-framework

Framework for running and organising QuickCheck test properties and HUnit test cases
http://bsp.lighthouseapp.com/projects/15661-hs-test-framework
83 stars 45 forks source link

Example.lhs fails to compile #18

Closed orlitzky closed 11 years ago

orlitzky commented 12 years ago

I was going to write a quick patch for Example.lhs to move the "maximum generated tests" configuration into the code re:

http://www.haskell.org/pipermail/beginners/2012-June/010169.html

The example fails to compile, though. Using the command at the top of the file (runghc fails in the same way):

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1
$ ghc -package test-framework -package test-framework-quickcheck -package test-framework-hunit -threaded Example.lhs -o Example                               
[1 of 1] Compiling Main             ( Example.lhs, Example.o )

Example.lhs:64:17:
    No instance for (QuickCheck-1.2.0.1:Test.QuickCheck.Testable
                       (Gen Prop))
      arising from a use of `testProperty'
    Possible fix:
      add an instance declaration for
      (QuickCheck-1.2.0.1:Test.QuickCheck.Testable (Gen Prop))
    In the expression: testProperty "sort2" prop_sort2
    In the second argument of `testGroup', namely
      `[testProperty "sort1" prop_sort1, testProperty "sort2" prop_sort2,
        testProperty "sort3" prop_sort3]'
    In the expression:
      testGroup
        "Sorting Group 1"
        [testProperty "sort1" prop_sort1, testProperty "sort2" prop_sort2,
         testProperty "sort3" prop_sort3]
batterseapower commented 11 years ago

Sorry for taking so long to get back to you.

I can't reproduce this issue with the latest Haskell Platform on HEAD, and I'm not quite sure what is going on. Perhaps you should do cabal install --only-dependencies in the example/ directory to get a consistent version of the required packages?

I've just changed the example in Git to use QuickCheck2, so that might fix the issue as well.

orlitzky commented 11 years ago

Yep, it works now.