Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Exceptions Handling and Unit Testing.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-09-21 (23:23)
From: chris.danx <chris.danx@n...>
Subject: Re: [Caml-list] Exceptions Handling and Unit Testing.
Oops!  I keep clicking reply instead of reply all! :(

Thanks for all the suggestions.  It looks like I was generalising the 
wrong thing (concentrating on handling the exception, rather than the 
identification of a test repeated for different inputs).

Instead I created a function which does the test and catches a specific 
exception but with the test data supplied as parameters.  This enables 
constructing tests as closures from sample cases (each case has a test 
name, sample data and a message should the test fail), with the 
extension to lists of sample cases being a trivial application of  Cases are added by putting them in a list.

Simple really. *slaps himself for being stupid*


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: