Breaking changes in Visual C++ 2015

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri May 8 12:45:44 PDT 2015


On 5/8/2015 7:00 AM, Chris wrote:
> The only drawback is that sometimes the logic of a program does not allow to
> test every little bit, especially when handling files is concerned.

This is an interesting problem, one that I faced with Warp.

The solution was to make the function being tested a function template. Then, in 
the unit test I replace the 'file' argument to the function with a static array 
of test data.

The term for it is 'type mocking', and it's fairly well explored territory. What 
I find most intriguing about it is it results in D programs consisting largely 
of template functions rather than plain functions.


More information about the Digitalmars-d mailing list