From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA29065; Tue, 21 Sep 2004 10:24:45 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 KAA28797 for ; Tue, 21 Sep 2004 10:24:44 +0200 (MET DST) Received: from kraid.nerim.net (smtp-102-tuesday.nerim.net [62.4.16.102]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i8L8OioJ012130 for ; Tue, 21 Sep 2004 10:24:44 +0200 Received: from [192.168.0.2] (planar.net0.nerim.net [213.41.168.102]) by kraid.nerim.net (Postfix) with ESMTP id 9187941C7B; Tue, 21 Sep 2004 10:24:43 +0200 (CEST) In-Reply-To: <414F3BC6.2010705@ntlworld.com> References: <414F3BC6.2010705@ntlworld.com> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Cc: Caml Mailing List From: Damien Doligez Subject: Re: [Caml-list] Exceptions Handling and Unit Testing. Date: Tue, 21 Sep 2004 10:24:43 +0200 To: "chris.danx" X-Mailer: Apple Mail (2.619) X-Miltered: at nez-perce with ID 414FE54C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; damien:01 damien:01 caml-list:01 chris:01 doligez:01 doligez:01 sep:01 assert:02 assert:02 exception:02 exception:02 unit:03 unit:03 wrote:03 exn:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sep 20, 2004, at 22:21, chris.danx wrote: > let some_construction_test some_op input exception error_msg = > try > let x = some_op input > in > OUnit.assert_failure error_msg > with > exception -> () Turn your pattern into a function: let some_construction_test some_op input (check_exception: exn -> unit) error_msg = try let x = some_op input in OUnit.assert_failure error_msg with e -> check_exception e -- Damien ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners