Deriver: qcheck and qcheck2
Closes #190
This PR introduces two derivation plugins:
-
qcheck -
qcheck2
The code and test is duplicated, in the vast majority it's only a renaming to QCheck to QCheck2 (excepts for fun_nary)
- utop # type t = int
val gen : t QCheck.Gen.t = <fun>
val arb : t QCheck.arbitrary =
{QCheck.gen = <fun>; print = None; small = None; shrink = None;
collect = None; stats = []}
─( 15:46:16 )─< command 2 >─────
- utop # type t = int [@@deriving qcheck2];;
type t = int
val gen : t QCheck2.Gen.t = <abstr>
This it not ideal as we only derive generators then call make on them, the best would be to use arbitrary for primitive types as they also have printers, shrinkers etc.
However after #195, #208 and this one, I'm getting tired of writing boilerplate code, but I will eventually do this in the future :)
Used @tmcgilchrist suggestion to reduce the code duplication and rebased to master. The commits should be squashed on merge, I'm not sure each of them compile and it's not that important if they're split.