Closed copy closed 8 years ago
This would be nice in principle, but I don't think it works, as __last_eq
would have the type 'a ref
which is forbidden in OCaml. I'm not really in favor of such dark magic ^^.
If you think it does work, feel free to re-open!
This is just an idea: The need to specify equality tests separately could be removed by bringing a special
(=)
into the scope of the test case which remembers its arguments, similar to this:Then, this idea can be extended to other comparison operators and possibly also custom equality. It's an ugly hack, but it makes tests cleaner, easier to write and allows mixing equality and normal tests in a test block.