vincent-hugot / qtest

Inline (Unit) Tests for OCaml
GNU General Public License v3.0
67 stars 8 forks source link

Quickcheck equality test: $Q= #39

Open copy opened 8 years ago

copy commented 8 years ago

I think this would be a useful addition, following the existing pattern. A quick glance at containers reveals that equality tests are not an uncommon use of $Q.

c-cube commented 8 years ago

That would be interesting, indeed. I don't have the time right now, and some details need to be settled first:

copy commented 8 years ago

That would be interesting, indeed. I don't have the time right now, and some details need to be settled first:

Cool, I might give this a try then. Regarding syntax, the syntax for equality tests is <lhs> <rhs> and the syntax for Quickcheck tests is <generator> (fun <generated value> -> <statement>), so the following seems the most obvious approach:

<generator> (fun <generated value> -> <lhs>) (fun <generated value> -> <rhs>)

Regarding equality predicate, I'd suggest adding it to the header (the same way the printer is set).