unittesting generic functions

Idan Arye via Digitalmars-d digitalmars-d at puremagic.com
Wed Aug 13 19:04:08 PDT 2014


On Thursday, 14 August 2014 at 01:38:56 UTC, Brian Schott wrote:
> On Thursday, 14 August 2014 at 01:10:54 UTC, Andrei 
> Alexandrescu wrote:
>> Destroy https://issues.dlang.org/show_bug.cgi?id=13291?
>>
>> Andrei
>
> So it'll look like this?
>
> functionBody:
>      blockStatement
>     | inStatement outStatement? bodyStatement?
>     | outStatement inStatement? bodyStatement?
>     | unittest bodyStatement
>     | unittest inStatement outStatement? bodyStatement
>     | unittest outStatement inStatement? bodyStatement
>     | bodyStatement
>     ;
>
> That is, a unittest always requires a body, and thus can't be 
> used in interfaces, correct?

Well, there's nothing to test in abstract functions, is there?

I'm more concerned about the unit test appearing before the code, 
when the usual convention is to put the unit tests after the code 
they are testing...


More information about the Digitalmars-d mailing list