Differences From Artifact [314aad0104b85557]:
- File        
tricks/test.d
- 2010-11-09 07:27:21 - part of checkin [0f02103885] on branch trunk - let, var, def became layer-neutral definition (not @val). scope splitting (let x=1;let x=2;let y=(let x=3);x is 1) is correctly implemented now. (user: kinaba) [annotate]
 
 
To Artifact [09cc57fcd7c969ca]:
- File        
tricks/test.d
- 2010-11-09 14:24:09 - part of checkin [2459e9a821] on branch trunk - refactored eof-driven REPL (user: kinaba) [annotate]
 
 
   13  void assert_throw(ExceptionType, T, string fn=__FILE__, size_t ln=__LINE__)(lazy      13  void assert_throw(ExceptionType, T, string fn=__FILE__, size_t ln=__LINE__)(lazy
   14  {                                                                                     14  {
   15          try                                                                           15          try
   16                  { t(); }                                                              16                  { t(); }
   17          catch(ExceptionType)                                                          17          catch(ExceptionType)
   18                  { return; }                                                           18                  { return; }
   19          catch(Throwable e)                                                            19          catch(Throwable e)
   20                  { onAssertErrorMsg(fn, ln, msg.length ? msg : "exception ["~e.to |    20                  { onAssertErrorMsg(fn, ln, msg.length ? msg : "bad exception\n >
   21          onAssertErrorMsg(fn, ln, msg.length ? msg : "no execption");             |    21          onAssertErrorMsg(fn, ln, msg.length ? msg : "not thrown");
   22  }                                                                                     22  }
   23                                                                                        23  
   24  /// Unittest helper that asserts an expression must not throw anything                24  /// Unittest helper that asserts an expression must not throw anything
   25                                                                                        25  
   26  auto assert_nothrow(T, string fn=__FILE__, size_t ln=__LINE__)(lazy T t, string       26  auto assert_nothrow(T, string fn=__FILE__, size_t ln=__LINE__)(lazy T t, string 
   27  {                                                                                     27  {
   28          try                                                                           28          try
   29                  { return t(); }                                                       29                  { return t(); }
   30          catch(Throwable e)                                                            30          catch(Throwable e)
   31                  { onAssertErrorMsg(fn, ln, msg.length ? msg : "exception ["~e.to |    31                  { onAssertErrorMsg(fn, ln, msg.length ? msg : "bad exception\n >
   32          assert(false);                                                                32          assert(false);
   33  }                                                                                     33  }
   34                                                                                        34  
   35  unittest                                                                              35  unittest
   36  {                                                                                     36  {
   37          auto error = {throw new Error("hello");};                                     37          auto error = {throw new Error("hello");};
   38          auto nothing = (){};                                                          38          auto nothing = (){};