Please reply to this to vote to assertNotThrown in std.unittests

David Nadlinger see at klickverbot.at
Tue Feb 8 09:24:13 PST 2011


On 2/8/11 4:30 PM, Andrei Alexandrescu wrote:
> Reply here to vote ONLY for the function assertNotThrown in Jonathan M
> Davis's std.unittests. Vote closes on Feb 15.

Sorry, I didn't phrase the part of my previous message concerning 
assertNotThrown and collectExceptionMsg quite clearly. What I meant is 
that I personally never felt the need for assertNotThrown and 
collectExceptionMsg, contrary to assertThrown, which I use pretty 
regularly. If others find these useful, I don't see any reasons not to 
include them, though.

Concerning assertNotThrown specifically, I usually just call the 
function in question – if it throws unexpectedly, the exception makes 
the unit test fail anyway. This approach obviously doesn't allow you to 
filter only a single exception type, but I have a hard time trying to 
imagine where you would really need something like that. Also, you can't 
specify an extra assert message, but I'd rather like to be able to use 
named unit test blocks for that (what was the result of the discussion 
on them again?).

David


More information about the Digitalmars-d mailing list