From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 7B259820A1 for ; Tue, 27 Aug 2013 11:43:21 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of oliver@first.in-berlin.de) identity=pra; client-ip=192.109.42.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="oliver@first.in-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of oliver@first.in-berlin.de) identity=mailfrom; client-ip=192.109.42.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="oliver@first.in-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@einhorn.in-berlin.de) identity=helo; client-ip=192.109.42.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="postmaster@einhorn.in-berlin.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArkBADh0HFLAbSoIkGdsb2JhbABagzyDeKpGkkKBJBYOAQEBAQkUCRgkgiQBAQEDASNLCwULCxoCCR0CAkUSBhMSh10DCQYECKVtiFADiXSBKY8bMweCaDR9A5dugS2EfY5X X-IPAS-Result: ArkBADh0HFLAbSoIkGdsb2JhbABagzyDeKpGkkKBJBYOAQEBAQkUCRgkgiQBAQEDASNLCwULCxoCCR0CAkUSBhMSh10DCQYECKVtiFADiXSBKY8bMweCaDR9A5dugS2EfY5X X-IronPort-AV: E=Sophos;i="4.89,967,1367964000"; d="scan'208";a="24877529" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Aug 2013 11:43:20 +0200 X-Envelope-From: oliver@first.in-berlin.de Received: from [10.51.84.94] (tmo-100-193.customers.d1-online.com [80.187.100.193]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id r7R9hHYg008317 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 27 Aug 2013 11:43:18 +0200 References: <521C6183.9010908@inria.fr> In-Reply-To: <521C6183.9010908@inria.fr> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Message-Id: <19C0D663-BB1E-4ECA-B438-0CDBACFC74EB@first.in-berlin.de> Cc: "caml-list@inria.fr" X-Mailer: iPad Mail (10B329) From: Oliver Bandel Date: Tue, 27 Aug 2013 11:43:14 +0200 To: Romain Bardou X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 Subject: Re: [Caml-list] ANN: should.ml, literate assertions for OCaml I think, the example looks very nice. :-) Above IMHO would be ">" ">=3D" 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 : > I'm not sure a language resembling plain English is a good idea (for > instance, does "above" mean ">" or ">=3D"?) but I like the tricks you used > to avoid the need for a preprocessor :) >=20 > Cheers, >=20 > --=20 > Romain Bardou >=20 > Le 26/08/2013 20:34, Mike Lin a =C3=A9crit : >> 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. >>=20 >> https://github.com/mlin/should.ml >> opam update && opam install should >>=20 >> Happy testing! >> Mike >>=20 >> Example: >>=20 >>=20 >> |open Should >>=20 >> let int_test_case () =3D >> let x =3D 123 in begin >> x $hould # equal 123; >> x $hould # not # equal 0; >>=20 >> x $hould # be # above 122; >> x $hould # be # at # most 124; >>=20 >> x $hould # be # within (122,123); >> x $houldn't # be # within (1,3) >> end >> | >>=20 >> | >> | >=20 >=20 > --=20 > 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