docs
docs copied to clipboard
Recipe: OCaml test suite
Use material collected when working on https://github.com/codewars/ocaml/issues/1 and https://github.com/codewars/ocaml/pull/2 and prepare a guide similar to other language specific authoring guides, like for example the one for Javascript.
Example kumite: https://www.codewars.com/kumite/620a7361d746e5000f36a021/
Features:
- TestLists, with and without labels
- TestCases, with and without labels
- Nested tests
- Nested labels
- Custom assertion messages and printers
Here is an example of a test suite using the optional pp_diff argument of assert_equal : https://www.codewars.com/kumite/62ff92cb211df8001c4b80c4
This argument is used to show the differences between the expected and actual answers in a custom way.
When working with lists, ~pp_diff and ~printer can be automatically generated with the OUnitDiff module, as demonstrated in its documentation.