Why think unit tests should be in their own source code hierarchy instead of side-by-side

Johan Engelen j at j.nl
Fri Mar 23 19:46:34 UTC 2018


On Thursday, 22 March 2018 at 15:18:40 UTC, Jacob Carlborg wrote:
> On Thursday, 22 March 2018 at 11:00:31 UTC, Atila Neves wrote:
>
>> Direct link:
>>
>> https://atilanevesoncode.wordpress.com/2018/03/22/keep-d-unittests-separated-from-production-code/
>
> I completely agree. Although my reason is mostly because there 
> will be too much code in a single file if the regular code and 
> unit tests are mixed in the same file.

Fully agree with this "too much code in a single file" point. I 
am confident that part of the reason of Phobos unittesting being 
very incomplete, is that adding unittests further clutters the 
codebase.
Moving all unittests to the bottom of the file (pulling them out 
of classes too) would resolve this issue in part.

- Johan



More information about the Digitalmars-d-announce mailing list