On 2/11/11 4:13 PM, Steve Schveighoffer wrote:
From:Andrei Alexandrescu<[email protected]>
When the unittest fails I go and edit the code as such:

     assert(foo(x), text("foo(", x, ") failed"));

As long as the unit test looks like this to begin with, I have no problem.  It 
should be the responsibility of the unit test writer to make sure the error 
messages clearly indicate what inputs cause the error.

I never start with the detailed message. I add them opportunistically as unittests fail. Works /perfectly/.

I also want to stress that this is a simple loop example, and not too difficult 
to understand.  I don't think complex factored code is a good idea to have.

Agreed, but I repeat: an overwhelming majority of std.datetime's unittests can be converted in simple loops, as I took the time to exemplify in another message.

BTW, where is text defined?  It should be available everywhere.

std.conv.


Andrei
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to