Reddit: why aren't people using D?
Nick Sabalausky
a at a.a
Thu Jul 23 13:48:14 PDT 2009
"Knud Soerensen" <4tuu4k002 at sneakemail.com> wrote in message
news:h49mfs$vf2$1 at digitalmars.com...
>
> Some time ago I need a script to get and process some data.
> I trough why not use D, but I couldn't find a function in the standard
> library which would get a simple web page with http.
> Instead of find and downloading other libraries I switched to peal and had
> it running in no time.
>
.....
>
> ** Unit test isolation
> I would like to be able to isolate the unit test,
> so that if one fail the next still runs.
>
You may want to keep an eye on my SemiTwist D Tools
http://www.dsource.org/projects/semitwist/
I haven't gotten around to releasing it yet, but it includes an alternate to
assert that delays the "exit app" until you tell it to:
int x = 7;
mixin(deferAssert!("x == 9"));
mixin(deferAssert!("2+2==5", "Reality is broken"));
flushAsserts(); // Can put this at the beginning of main to wait for all
unittests to run before bailing.
// Now you get both errors, not just the first one.
Unfortunately I wasn't able to get around the awkward "mixin" part though.
(It also doesn't seem to work inside in{} out{} blocks, not sure why yet, I
think there may be some limitation I'm not aware of about the code allowed
in those.)
In the same project I'm also working on a library that will provide, with
one import, a full kitchen-sink scripting-style environment that should make
the tasks like your example above much much easier in D.
More information about the Digitalmars-d
mailing list