Do everything in Java…

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 5 04:04:11 PST 2014


On Fri, 05 Dec 2014 11:53:10 +0000
Chris via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> Now is the right time to confess. I hardly ever use unit tests 
> although it's included (and encouraged) in D. Why? When I write 
> new code I "unit test" as I go along, with
> 
> debug writefln("result %s", result);
ah, that debug code is so annoying. besides, it requires importing
std.stdio, which is not always desirable. and... and... and... you can
move it to unittest section and then just run it with rdmd! hee-hoo,
now you got best from the both worlds: you can check that your code is
working and you have unittests!

just don't tell anyone that your carefully crafted unittests are simple
debug statements moved to another place. i'm doing that all the time
and never been caught.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141205/ea0d0128/attachment.sig>


More information about the Digitalmars-d mailing list