[dmd-internals] changeset 455

Sean Kelly sean at invisibleduck.org
Wed May 5 14:11:05 PDT 2010


On May 5, 2010, at 12:42 PM, Andrei Alexandrescu wrote:

> Sean Kelly wrote:
>> On May 5, 2010, at 9:37 AM, Andrei Alexandrescu wrote:
>>> Denis wrote:
>>>> On Tue, May 4, 2010 at 3:11 AM, Andrei Alexandrescu <andrei at erdani.com> wrote:
>>>> What's wrong with automatically wrapping unittests with try/catch
>>>> block? Why is the "bool g_runningUnittests;" even necessary?
>>>> Anyway, I believe top-level unittest assert behavior shouldn't differ
>>>> from other asserts.
>>> That would be perfect.
>> I'd happily change the onUnittestError handler to throw an AssertError instead of printing and continuing, but the better fix would be to rip this new logic out of the compiler as well, so the handler isn't even needed.  Since we don't have macros in D2, I guess we'd really need a language-level "expect" function to get the correct file and line info in the log message.
> 
> We don't need expect() in the language. Check std.contracts.enforce to see how __FILE__ and __LINE__ can be captured.

Huh, I wouldn't have expected that to work.  Cool!


More information about the dmd-internals mailing list