From: Simon Cruanes <simon.cruanes.2007@m4x.org>
To: OCaml users <caml-list@inria.fr>
Subject: [Caml-list] [ANN] qtest 2.2, merged with qcheck
Date: Sun, 3 Apr 2016 14:46:55 +0200 [thread overview]
Message-ID: <20160403124655.GS24122@carty.lan> (raw)
[-- Attachment #1: Type: text/plain, Size: 1718 bytes --]
Hello,
I'm very happy to announce that Qtest, a tool that allows one to write
tests in comments directly next to the tested functions
(originally developed for testing batteries-included), and QCheck, a
quickcheck clone I have been developing for a while, have been merged
in the release qtest-2.2. Qtest provides facilities to write both
unit tests (based on OUnit), as in
(*$T [1;2;3] = List.sort compare [3;2;1] *)
and quickcheck-like random tests, as in
(*$Q Q.(list int) (fun l -> sort l = sort (sort l)) *)
The support for random tests now relies upon qcheck. Our goal with this
merge is to provide both a tool for people who want to keep tests as
close as possible to their code (even for versions of OCaml that do not
support ppx), and a feature-full library for people who prefer to keep
their tests separate.
Documentation for qcheck (the library) can be found at
http://cedeela.fr/~simon/software/qcheck/ .
Documentation for qtest (the tool, and how to use it) can be found at
https://github.com/vincent-hugot/iTeML/blob/3bc5ecca75487771db512902d6e533ab059b8e34/README.adoc
Note that this release breaks compatibility with the previous versions
of qcheck (mostly because the `'a arbitrary` type is now much richer,
packing together a random generator, a printer, a shrinking
functions…). To upgrade tests from qcheck, it is easy to convert
a random generator into an `'a arbitrary` using `QCheck.make`.
For writing complex generators, Gabriel Scherer's library might be
useful: https://github.com/gasche/random-generator .
Cheers!
--
Simon Cruanes
http://weusepgp.info/
key 49AA62B6, fingerprint 949F EB87 8F06 59C6 D7D3 7D8D 4AC0 1D08 49AA 62B6
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next reply other threads:[~2016-04-03 12:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-03 12:46 Simon Cruanes [this message]
2016-04-30 20:14 ` Manfred Lotz
2016-05-01 13:35 ` Manfred Lotz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160403124655.GS24122@carty.lan \
--to=simon.cruanes.2007@m4x.org \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox