Unttests for nested functions

Derek Parnell derek at psych.ward
Mon May 29 16:49:54 PDT 2006


On Mon, 29 May 2006 23:15:00 +0000 (UTC), BCS wrote:

> that is what I was expecting. :P  Any thoughts on how to make it so you can?
> (ref. my second post)
> 
> In article <1o4n88vezpkym$.1cj5tqvwrl0up$.dlg at 40tude.net>, Derek Parnell says...
>>
>>On Sun, 28 May 2006 02:46:24 +0000 (UTC), BCS wrote:
>>
>>> how do I unittest bar?
>>
>>Currently one can't directly test it using unit tests, however on the
>>assumption that the outer function uses the inner function I guess you can
>>test it indirectly, plus you can also use inner asserts and DbC.
> [...]

The obvious way would be to allow unit test blocks to be nested inside
functions, classes, and structs too. And if we are going that way, allow
'import' statements to allowed inside unit test blocks. 

Yes, I know there are technical issues to solve but Walter's a smart cookie
and will be able to solve them to the benefit of the D language. If D wants
to have a few differentiating points then comprehensive DbC and quality
control is a good place to start.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocracy!"
30/05/2006 9:45:48 AM



More information about the Digitalmars-d-learn mailing list