Which tools do you miss in D?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jan 27 08:01:30 PST 2014


On 1/26/14 11:16 PM, Knud Soerensen wrote:
> I miss check_expect from racket.
>
> It is used for unit testing
>
> check_expect(expression, result)
> Will test if expression equals result
> if it is not it print "Got expression but expected result" with file and
> line information.
>
> In D making unit tests is more tedious.
> When I develop in D I typical start with.
>
> writeln(expression)
> writeln(result)
>
> then when the code is working I replace it with
> assert(expression==result)
>
> Then if I do some refactoring which don't work I change again
> writeln(expression)
> writeln(result)
>
> When it is working again
> assert(expression==result)
>
> This back and forth process in D is very tedious compared to Racket.

I do the same. There's a enhancement request in bugzilla for having 
assert detect these patterns itself.

Andrei




More information about the Digitalmars-d mailing list