Suggestion (ping Walter): Improve unit testing.

Jason House jason.james.house at gmail.com
Sun Apr 22 09:42:13 PDT 2007


Ary Manzana wrote:
> I also very much agree.
> 
> If a summary is going to be printed for the unittests (i.e. TESTS: 1 
> PASSED: 0  FAILED: 1), it could be great also to label unittests with a 
> name. This is more informative that just the file and line where the 
> assertion failed. Compare "foo.bar.Exception.AssertException on 
> test.d(7)" to "heap sort makes list sorted".
> 
> To to this, you can optionaly pass a string to the unittest:
> 
> unittest("heap sort makes list sorted") {
>    // ...
> }
> 

This method of output would also implicitly require unit tests are run 
as if they were in try{} blocks.  Currently, a unit test failure makes 
the entire program exit (and other unit tests are not run).  It'd 
probably be good to expand the output a bit more to distinguish which 
tests were run even though a unit test in an imported module failed.



More information about the Digitalmars-d mailing list