unittext extension proposal

Leandro Lucarella llucax at gmail.com
Mon Aug 10 10:34:51 PDT 2009


Andrei Alexandrescu, el 10 de agosto a las 10:15 me escribiste:
> Leandro Lucarella wrote:
> >Sergey Gromov, el 10 de agosto a las 16:32 me escribiste:
> >>Sat, 08 Aug 2009 17:32:30 -0400, Jeremie Pelletier wrote:
> >>
> >>>I just had an idea to help keep track of unittests, right now we're turning 
> >>>on printf's at the beginning of a test to know which one fails, and adding 
> >>>printfs everywhere quickly becomes redundant. Also if the test succeeds and 
> >>>execution fails at some other point, the last printf is then misleading.
> >>>
> >>>---
> >>>module sample;
> >>>unittest("myTest") {}
> >>>---
> >>Named unittests is a rather often requested feature.  Others also wanted
> >>__UNITTEST__ to expand into a name of the current unittest.  Also a
> >>'weak assert' was requested which tests and prints a message but delays
> >>exit until the end of the current unit test.
> >It would be nice if unittest could be extended to have import statements.
> 
> I use:
> 
> version(unittest) import std.stdio;

I know you can hack arround it, but it would be nice if the hack is not
needed. And being able to do import in any scope is nice in the sense that
you don't have to "pollute" al your file with an import (as bad as it is
that import x; imports all its symbols in the global scope =).

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
CAYO HUGO CONZI  ---  TENIA PUESTA PELUCA
	-- Crónica TV



More information about the Digitalmars-d mailing list