[Issue 11636] -unittest flag preserves assert() statements but still allows in/out contracts to be stripped

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 28 15:02:59 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11636



--- Comment #1 from Joseph Rushton Wakeling <joseph.wakeling at webdrake.net> 2013-11-28 15:02:56 PST ---
(In reply to comment #0)
> This inconsistency should surely be fixed -- if -unittest requires assert
> statements to be present, it should require _all_ assert statements be present,
> including those in in- and out-contracts.

Alternatively, if the point of view is that -unittest -release should
effectively test code "as it is with the -release flag active" (i.e. so
contracts _should_ be stripped), there needs to be some way of checking if
-release has been used, and conditionally selecting different unittests
accordingly, e.g.:

    version(release) assert(/* something appropriate to -release mode */);
    else assert(/* something else */);

... but code being tested "as it is with the -release flag active" doesn't seem
to me to sit well with keeping in-body assert() statements active.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list