Helper unit testing functions in Phobos (possible std.unittests)

Nick Sabalausky a at a.a
Sat Nov 6 18:35:29 PDT 2010


"Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message 
news:mailman.138.1289084125.21107.digitalmars-d at puremagic.com...
> On Saturday 06 November 2010 12:28:02 Masahiro Nakagawa wrote:
>> I don't know this module's usability, but is getExcMsg useful?
>> I can't imagine useful situation.
>> In addition, I grepped your datetime.d and getExcMsg not found :(
>>
>> If possible, I want the mock, stub and related features.
>
> It's used to test unittests.d itself, but I don't think that I'm using it 
> in
> datetime.d at the moment. The idea is to use it if you want to verify that 
> an
> exception says exactly what you want it to say (especially if you could 
> get
> multiple exceptions of the same type but with different messages from a
> function). I will grant you, however, that it's one of the less useful
> functions.
>

I'm not suggesting getExcMsg be removed, but if you ever need to verify an 
exception's message is exactly matches a specific string, then you're almost 
certainly using exceptions the wrong way to begin with.




More information about the Digitalmars-d mailing list