From: Oliver Bandel <oliver@first.in-berlin.de>
To: Romain Bardou <romain.bardou@inria.fr>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] ANN: should.ml, literate assertions for OCaml
Date: Tue, 27 Aug 2013 11:43:14 +0200 [thread overview]
Message-ID: <19C0D663-BB1E-4ECA-B438-0CDBACFC74EB@first.in-berlin.de> (raw)
In-Reply-To: <521C6183.9010908@inria.fr>
I think, the example looks very nice. :-)
Above IMHO would be ">"
">=" might be # equal # or # above... if the language allows it...
Or, when looking at the example, there is at-most...
...if english language allows, possibly at-least would be ok.
(But mothertongue english speakers might disagree.)
Ciao,
Oliver
Am 27.08.2013 um 10:21 schrieb Romain Bardou <romain.bardou@inria.fr>:
> I'm not sure a language resembling plain English is a good idea (for
> instance, does "above" mean ">" or ">="?) but I like the tricks you used
> to avoid the need for a preprocessor :)
>
> Cheers,
>
> --
> Romain Bardou
>
> Le 26/08/2013 20:34, Mike Lin a écrit :
>> Should.ml is a little library for writing assertion statements in a
>> domain-specific language roughly resembling plain English. This makes
>> lengthy series of assertions (such as in unit tests) a little nicer to
>> read - example pasted below. Through some mild abuse of objects and
>> operators, I avoided the need for any preprocessor or syntax extension.
>>
>> https://github.com/mlin/should.ml
>> opam update && opam install should
>>
>> Happy testing!
>> Mike
>>
>> Example:
>>
>>
>> |open Should
>>
>> let int_test_case () =
>> let x = 123 in begin
>> x $hould # equal 123;
>> x $hould # not # equal 0;
>>
>> x $hould # be # above 122;
>> x $hould # be # at # most 124;
>>
>> x $hould # be # within (122,123);
>> x $houldn't # be # within (1,3)
>> end
>> |
>>
>> |
>> |
>
>
> --
> Caml-list mailing list. Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
prev parent reply other threads:[~2013-08-27 9:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-26 18:34 Mike Lin
2013-08-27 8:21 ` Romain Bardou
2013-08-27 9:43 ` Oliver Bandel [this message]
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=19C0D663-BB1E-4ECA-B438-0CDBACFC74EB@first.in-berlin.de \
--to=oliver@first.in-berlin.de \
--cc=caml-list@inria.fr \
--cc=romain.bardou@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;
as well as URLs for NNTP newsgroup(s).