Useful for asserting test cases for EN.600.426 without all that copy 'n paste and visual comparing.
The code is admittedly sloppy and makes some fragile assumptions. It errors very easily and can't assert exceptions. It expects doctests of the form:
(*
# foo param another_one and_another_one;;
- : bytes list = ["major"; "key"]
*)
You can have as many of these as you want in a comment (separated by newlines), but they all must follow this format (they can have newlines in them, a test is defined as the code between #
characters in a comment; the result is everything after the ;;
).
If I get a chance (I probably won't), I'll update this to be a bit more resiliant (and support things like defining fixtures for tests).
# ./test.ml hw1.ml
It currently breaks on HW1 because one of the doc comments isn't correctly formatted. Also, you need to expose (uncomment) the sodoku grids otherwise those tests fail with an error.
You need batteries and ocamlscript to run this. You can install them with opam install batteries
and opam install ocamlscript
.