OUnit

OUnit.assert_raises

例外は, assert_raises (HogeException) (fun _ -> proc_which_raise_exception) とか書いた気が.

OUnit.assert_equal

値を表示するには, let assert_equal_exp = assert_equal ~printer:string_of_exp とかすれば,いい.~printerに設定する関数の型は,'a -> string.

OCamlMakefile

FIXTURES = hoge.ml huga.ml TESTS = test_hoge.ml test_huga.ml MAIN = test_main.ml PACKS = oUnit RESULT = $(MAIN:.ml=) SOURCES = $(FIXTURES) $(TESTS) $(MAIN) all: bc ./$(RESULT) include OCamlMakefileとか書いておけば、makeとたたくと、かってに…