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] OUnit usage
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: mgushee@h...
Subject: [Caml-list] OUnit usage
Hello, all--

This probably qualifies as a dumb question, but I hope you will indulge my curiosity.

I would like to try OUnit. I haven't done much formal unit testing, and am also fairly 
new to OCaml, but since I want to develop a serious software package I guess it's 
time to get serious about testing. Anyway, I am having a little trouble understanding 
how to construct a test. The main point of confusion is the TestCase constructor. 
The OUnit docs say:

  type test =
  | TestCase of (unit -> unit)
  | TestList of test list
  | TestLabel of string * test

I would like to know what sort of arguments to give TestCase. The examples 
provided don't mean much to me:

  TestCase (fun _ -> ())

This looks like syntactically correct but meaningless code, no?

If I could see 1 or 2 simple but realistic examples, I think that would clear up the 

All suggestions appreciated.

Matt Gushee
Englewood, CO USA
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: