From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 498FFBCAF for ; Fri, 10 Jun 2005 13:49:51 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j5ABnoiP020871 for ; Fri, 10 Jun 2005 13:49:50 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA03504 for ; Fri, 10 Jun 2005 13:49:50 +0200 (MET DST) From: padiolea@irisa.fr Received: from smtp.irisa.fr (smtp.irisa.fr [131.254.254.26]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5ABno6e015982 for ; Fri, 10 Jun 2005 13:49:50 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.irisa.fr (Postfix) with ESMTP id 0F7AFFABB; Fri, 10 Jun 2005 13:49:50 +0200 (CEST) Received: from smtp.irisa.fr ([131.254.254.26]) by localhost (meli.irisa.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25794-09; Fri, 10 Jun 2005 13:49:48 +0200 (CEST) Received: from mail.irisa.fr (melo.irisa.fr [131.254.254.28]) by smtp.irisa.fr (Postfix) with ESMTP id BE565FAA6; Fri, 10 Jun 2005 13:49:47 +0200 (CEST) Received: from 131.254.50.45 (SquirrelMail authenticated user padiolea) by mail.irisa.fr with HTTP; Fri, 10 Jun 2005 13:49:47 +0200 (CEST) Message-ID: <37163.131.254.50.45.1118404187.squirrel@mail.irisa.fr> In-Reply-To: <42A8E1E0.9070902@gmail.com> References: <42A8E1E0.9070902@gmail.com> Date: Fri, 10 Jun 2005 13:49:47 +0200 (CEST) Subject: Re: [Caml-list] QuickCheck for OCaml? To: "Christopher Campbell" Cc: caml-list@inria.fr User-Agent: SquirrelMail/1.4.4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: by amavisd-new at irisa.fr X-Miltered: at concorde with ID 42A97E5E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42A97E5E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; irisa:01 caml-list:01 ocaml:01 ocaml:01 irisa:01 caml-list:01 beginner's:01 beginners:01 bug:01 hacks:01 assert:01 assert:01 integer:01 functions:01 bin:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.2 required=5.0 tests=NO_REAL_NAME autolearn=disabled version=3.0.2 X-Spam-Level: > 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 >