On Thu, 2007-07-05 at 19:37 -0400, Thomas Hartman wrote:

> I am a total quickcheck noob. Is there a way to find out what
> predicate test "<function>" is, below? 

> testMyBreak    = quickCheck $ \p l -> myBreak p (l :: [Int]) == break p l 

Well - you could try naming the qc property?  I.e.

        prop_myBreak p l = myBreak p l == break p l
        testMyBreak = quickCheck prop_myBreak

> Also, is there a way I can ask quickcheck to test lists of various
> built in types, not just Int? 

Yes.  You need to declare instances of 'Arbitrary' for custom data
types, which allows QuickCheck to manufacture random values of that
type.

-k

PS: Is this use of uPIO legal?  Sound?  Sensible?

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


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to