val assert_equal :
?cmp:('a->'a-> bool)->?printer:('a-> string)->?msg:string ->'a->'a->
unit
Compares two values, when they are not equal a failure is signaled. The cmp parameter can be used to pass a different compare function. This parameter defaults to ( = ). The optional printer can be used to convert the value to string, so a nice error message can be formatted. When msg is also set it can be used to identify the failure.
In certain condition test can be written but there is no point running it, because they are not significant (missing OS features for example). In this case this is not a failure nor a success. Following function allow you to escape test, just as assertion but without the same error status.
A test skipped is counted as success. A test todo is counted as failure.
val skip_if : bool ->string -> unit
skip cond msg If cond is true, skip the test for the reason explain in msg. * For example skip_if (Sys.os_type = "Win32") "Test a doesn't run on windows".
val todo : string -> unit
The associated test is still to be done, for the reason given.
Compare Functions
val cmp_float : ?epsilon:float ->float ->float -> bool
Compare floats up to a given relative error.
Bracket
A bracket is a functional implementation of the commonly used setUp and tearDown feature in unittests. It can be used like this: