Please reply to this to vote to collectExceptionMsg in std.unittests
spir
denis.spir at gmail.com
Tue Feb 8 17:17:02 PST 2011
On 02/08/2011 06:29 PM, David Nadlinger wrote:
> On 2/8/11 4:29 PM, Andrei Alexandrescu wrote:
>> Reply here to vote ONLY for the function collectExceptionMsg in Jonathan
>> M Davis's std.unittests. Vote closes on Tue Feb 15.
>
> As I stated in the assertNotThrown thread, I don't see any reason why this
> shouldn't be included if it's helpful for other people, even though I
> personally didn't feel the need for it so far.
>
> Since the main use case seems to be in unit tests to check if the correct
> exception messages are produced, I'd suggest adding a short note about that to
> the documentation comment – or is this going to end up in a new std.unittest
> module anyway? I thought it would be merged into std.exception…
This is just one use case reason why me preferred assert idiom has the form
assert ( expression, expectation)
if expectation is a string --and the outcome isn't one-- then the outcome is
to!string'ed. just what you need. Very useful too, in several other cases of
outcomes (I mean only when throws, just regular results that are not easily
expressible in code).
Denis
--
_________________
vita es estrany
spir.wikidot.com
More information about the Digitalmars-d
mailing list