[dmd-internals] changeset 455

Jason House jason.james.house at gmail.com
Wed May 5 05:42:25 PDT 2010


On May 5, 2010, at 4:19 AM, Denis <2korden at gmail.com> wrote:

> What's wrong with automatically wrapping unittests with try/catch
> block?

I believe that's what everyone except Walter wants :) if I understand  
correctly, a non-throwing assert is more efficient than a throwing  
assert. Nobody cares about performance when an assert fails, but this  
creates performance differences when asserts pass.



> Anyway, I believe top-level unittest assert behavior shouldn't differ
> from other asserts.

Me too. Anything with the same function name/signature should behave  
the same. Maybe the simplest solution is to have one function that  
throws and one that aborts?

I hate how, with the current design, someone can't write their own  
helper functions that use assert. e.g.
unittest{
   foreach(x; 0..10)
     validate_foo(bar(x), x);
}



More information about the dmd-internals mailing list