Re: unittest questions

2010-08-23 Thread Steven Schveighoffer
On Thu, 19 Aug 2010 14:08:33 -0400, Johannes Pfau s...@example.com wrote: Hi, I wrote some unittests using the built-in d unittest and a came across 2 problems: 1) I have some code that accepts both delegates and functions. How can a unittest explicitly check the function part? Whenever I add

Re: unittest questions

2010-08-20 Thread Johannes Pfau
On 20.08.2010 01:17, Jonathan M Davis wrote: If you declare a nested function as static, it shouldn't be a delegate. Also, I don't believe that you need the semicolon after the function declaration. - Jonathan m Davis Thanks for all the answers. I guess I'll just declare the functions as

unittest questions

2010-08-19 Thread Johannes Pfau
Hi, I wrote some unittests using the built-in d unittest and a came across 2 problems: 1) I have some code that accepts both delegates and functions. How can a unittest explicitly check the function part? Whenever I add a function in an unittest block it becomes a delegate.

Re: unittest questions

2010-08-19 Thread bearophile
Johannes Pfau: 1) I have some code that accepts both delegates and functions. How can a unittest explicitly check the function part? Whenever I add a function in an unittest block it becomes a delegate. You may define it outside the unittest{} block (that is a function) and wrap everything

Re: unittest questions

2010-08-19 Thread Jonathan M Davis
On Thursday, August 19, 2010 11:08:33 Johannes Pfau wrote: Hi, I wrote some unittests using the built-in d unittest and a came across 2 problems: 1) I have some code that accepts both delegates and functions. How can a unittest explicitly check the function part? Whenever I add a function