caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: padiolea@irisa.fr
To: "Christopher Campbell" <cyberdanx@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] QuickCheck for OCaml?
Date: Fri, 10 Jun 2005 13:49:47 +0200 (CEST)	[thread overview]
Message-ID: <37163.131.254.50.45.1118404187.squirrel@mail.irisa.fr> (raw)
In-Reply-To: <42A8E1E0.9070902@gmail.com>

> Hi,
>
> Are there any QuickCheck like tools for OCaml?  Searched on google, but
> nothing came up.  There are unit testing libraries like OUnit, but I
> haven't came across anything like QuickCheck yet.

I use this:
 lfs.irisa.fr/~pad/hacks/quickcheck.ml

All you have to do is include this library and then put in your code
rules such as

let _ = assert
 ((Quickcheck.laws "rev" (fun xs -> reverse (reverse xs) = xs)
   (Quickcheck.lg Quickcheck.ig)) = None)

the lg and ig functions are generators (list and integer generators).


By the way it also include a unit framework, but
it is just
  let testunitframework b = assert b   :)
that you use by writing for instance

let _ = testunitframework (List.map (fun x -> x +1) [1;2;3;4] = [2;3;4;5])






>
>
> Regards,
> Chris Campbell
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>



  parent reply	other threads:[~2005-06-10 11:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-10  0:42 Christopher Campbell
2005-06-10  9:18 ` [Caml-list] " Fermin Reig
2005-06-10 11:49 ` padiolea [this message]
2005-06-11 14:36 ` Christian Lindig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37163.131.254.50.45.1118404187.squirrel@mail.irisa.fr \
    --to=padiolea@irisa.fr \
    --cc=caml-list@inria.fr \
    --cc=cyberdanx@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).