www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - no output in unittest

reply Florian RIVOAL <Florian_member pathlink.com> writes:
i have been playing around with unittest, and i am quite happy that it is there.
but why is it impossible to display something from there? when i call writef
nothing happens.

sure, asserts are a good thing, but sometimes, reading some text output is just
the most simple way to check if everything is write. Usualy, the tests i perform
contain as much printfs as asserts. maybe more. If some people prefer to use
only assert, why not. but i am not sure why the language should prevent me to
output text in the unittext.
Jul 13 2004
parent reply "Ben Hinkle" <bhinkle mathworks.com> writes:
I've used printf in unittests just fine, so there might be a problem with
writef.

"Florian RIVOAL" <Florian_member pathlink.com> wrote in message
news:cd0nej$30v$1 digitaldaemon.com...
 i have been playing around with unittest, and i am quite happy that it is
there.
 but why is it impossible to display something from there? when i call
writef
 nothing happens.

 sure, asserts are a good thing, but sometimes, reading some text output is
just
 the most simple way to check if everything is write. Usualy, the tests i
perform
 contain as much printfs as asserts. maybe more. If some people prefer to
use
 only assert, why not. but i am not sure why the language should prevent me
to
 output text in the unittext.
Jul 13 2004
parent reply Regan Heath <regan netwin.co.nz> writes:
Or you've placed your unittest in the 'wrong' place, is it running at all, 
try assert(0);

As posted by Duncan earlier sometimes depending on where you place your 
unittest it does not run.

On Tue, 13 Jul 2004 10:24:53 -0400, Ben Hinkle <bhinkle mathworks.com> 
wrote:
 I've used printf in unittests just fine, so there might be a problem with
 writef.

 "Florian RIVOAL" <Florian_member pathlink.com> wrote in message
 news:cd0nej$30v$1 digitaldaemon.com...
 i have been playing around with unittest, and i am quite happy that it 
 is
there.
 but why is it impossible to display something from there? when i call
writef
 nothing happens.

 sure, asserts are a good thing, but sometimes, reading some text output 
 is
just
 the most simple way to check if everything is write. Usualy, the tests i
perform
 contain as much printfs as asserts. maybe more. If some people prefer to
use
 only assert, why not. but i am not sure why the language should prevent 
 me
to
 output text in the unittext.
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 13 2004
parent Florian RIVOAL <Florian_member pathlink.com> writes:
IIRC assert(0) does fail, and i still get no output. I ll try to play around a
bit more with this, to be sure of what's happening, and I ll tell you all what
happens then.

In article <opsa3j4qwd5a2sq9 digitalmars.com>, Regan Heath says...
Or you've placed your unittest in the 'wrong' place, is it running at all, 
try assert(0);
Jul 13 2004