Diff
Not logged in

Differences From Artifact [314aad0104b85557]:

To Artifact [09cc57fcd7c969ca]:


13 13 void assert_throw(ExceptionType, T, string fn=__FILE__, size_t ln=__LINE__)(lazy T t, string msg="") 14 14 { 15 15 try 16 16 { t(); } 17 17 catch(ExceptionType) 18 18 { return; } 19 19 catch(Throwable e) 20 - { onAssertErrorMsg(fn, ln, msg.length ? msg : "exception ["~e.toString()~"]"); } 21 - onAssertErrorMsg(fn, ln, msg.length ? msg : "no execption"); 20 + { onAssertErrorMsg(fn, ln, msg.length ? msg : "bad exception\n >> "~e.toString()); } 21 + onAssertErrorMsg(fn, ln, msg.length ? msg : "not thrown"); 22 22 } 23 23 24 24 /// Unittest helper that asserts an expression must not throw anything 25 25 26 26 auto assert_nothrow(T, string fn=__FILE__, size_t ln=__LINE__)(lazy T t, string msg="") 27 27 { 28 28 try 29 29 { return t(); } 30 30 catch(Throwable e) 31 - { onAssertErrorMsg(fn, ln, msg.length ? msg : "exception ["~e.toString()~"]"); } 31 + { onAssertErrorMsg(fn, ln, msg.length ? msg : "bad exception\n >> "~e.toString()); } 32 32 assert(false); 33 33 } 34 34 35 35 unittest 36 36 { 37 37 auto error = {throw new Error("hello");}; 38 38 auto nothing = (){};