Compiler generated assertion error message

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 20 13:04:32 PDT 2014


On 2014-06-19 19:52, Dicebot wrote:
> On a related topic:
>
> Feature like this is extremely convenient for unit tests. However using
> assertions in unit test blocks does not fit well with any custom test
> runner that does not immediately terminate the application (because
> AssertionError is an Error).

There's an assert handler in druntime [1], but that expects the 
implementation to be nothrow, so you cannot throw an exception.

> I'd personally love some way to get such formatted expression for any
> library function.
>
> What is the official stance on this?

[1] 
https://github.com/D-Programming-Language/druntime/blob/master/src/core/exception.d#L374

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list