unittest blocks not being run inside of class and struct templates

NoBigDeal256 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 24 20:13:43 PDT 2017


On Tuesday, 25 July 2017 at 02:18:41 UTC, Adam D. Ruppe wrote:
> On Tuesday, 25 July 2017 at 02:11:20 UTC, NoBigDeal256 wrote:
>> it passes when it should fail because the unittest block is 
>> never executed. Why is this?
>
> Did you actually instantiate the class somewhere? A template 
> has no concrete code unless created with an argument 
> somewhere...

What if it's instantiated in another module? Right now I'm having 
issues where if I run 'dmd a.d b.d -unittest' and the class 
template in b.d is instantiated in a.d and it compiles and the 
tests inside my class template run as they should, but when using 
'dub test' the tests in my class template don't run at all as if 
it isn't instantiated in a.d even though it is. This is the 
original issue that I had that prompted me to create this thread.


More information about the Digitalmars-d-learn mailing list