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 <[email protected]> >>>> 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! _______________________________________________ dmd-internals mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/dmd-internals
